all groups > dotnet remoting > september 2007 >
You're in the dotnet remoting group:
Events lose connection to localhost
dotnet remoting:
Posts to several groups have yielded no answers yet. Perhaps this one has a more experienced readership. :,) Situation: (1) Application subscribes to events generated by a service, via Remoting and an event wrapper. Both are on the same machine. (2) LAN cable is disconnected from the machine. (3) App receives no more events! However, the remoting proxy is still active and the application can invoke methods in the service. The service reports an exception that "the connection has been forcibly closed" when it tries to raise the event to the app. Modified Situation: (1) LAN cable is disconnected from the machine. (2) Application starts and subscribes as before. (3) LAN cable is connected. (4) LAN cable is disconnected. (5) NO PROBLEMS! For obvious reasons, having the user disconnect the LAN while they start the
Yes, it is XP Pro. If there is a KB article, it's not keyed under any of the terms I used to search for it. However, your mention of the Loopback Adapter sent me down some new paths that hinted there may be something there. I will try it on Monday (10/1) and let you know what happens. [quoted text, click to view] "Doug Semler" wrote: > "John W." <JohnW@discussions.microsoft.com> wrote in message > news:FD23AB78-FF72-4F98-8546-ECDE6A434D68@microsoft.com... > > Situation: (1) Application subscribes to events generated by a service, via > > Remoting and an event wrapper. Both are on the same machine. (2) LAN > > cable is disconnected from the machine. (3) App receives no more events! > > However, the remoting proxy is still active and the application can invoke >> methods in the service. The service reports an exception that "the >> connection has been forcibly closed" when it tries to raise the event >> to the app. > > > > Modified Situation: (1) LAN cable is disconnected from the machine. >> (2) Application starts and subscribes as before. (3) LAN cable is >> connected. (4) LAN cable is disconnected. (5) NO PROBLEMS! > > > > For obvious reasons, having the user disconnect the LAN while they >> start the application is not an acceptable procedure. What can be >> done? > > > Is this on XP? The TCP stack isn't loaded if you don't have a cable > connected for some gawd awful reason even if you have a network card. > > Since you are on the local PC, you can use the IpcClient/Server channels OR > you can install (i think available on xp sp 2 or later, but maybe some other > ones) the "loopback" network driver from add/remove programs. > > I think there's a KB article out there about this issue. > > -- > Doug Semler, MCPD > a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh). > The answer is 42; DNRC o- > Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira > erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg? >
Found a time slot to check it today (never would have found it without your updated directions!), and... Rats! That wasn't the solution. [quoted text, click to view] "Doug Semler" wrote: > "Doug Semler" <dougsemler@gmail.com> wrote in message > news:eVJHJcfAIHA.5960@TK2MSFTNGP05.phx.gbl... > > > Since you are on the local PC, you can use the IpcClient/Server channels > > OR you can install (i think available on xp sp 2 or later, but maybe some > > other ones) the "loopback" network driver from add/remove programs. > > Add hardware that is.... Install Manually...Network > Adapters...Microsoft...Microsoft Loopback Adapter > > -- > Doug Semler, MCPD > a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh). > The answer is 42; DNRC o- > Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira > erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg? >
Can't do the disable thing. This connection is one of several to identical services on other machines. I need to detect loss of connectivity to the other servers, and recovery of those connections occurs flawlessly right now. I just need the localhost connection to either break both links (events and remoting proxy) or leave both links intact instead of breaking just one and leaving the one I use to detect the break. IPC may be the solution path, but there's a bunch of learning to be done before I can go there, and then the localhost connection (and service?) becomes unique. Ugh. [quoted text, click to view] "Doug Semler" wrote: > Sorry...Google lookup DisableDHCPMediaSense...and follow the directions > there. if that doesn't work, i'd suggest switching to IPCServer/Client > communication when the remoting is on the local system (that way you don't > require the TCP/IP stack....and it's much faster) > > -- > Doug Semler, MCPD
[quoted text, click to view] "John W." <JohnW@discussions.microsoft.com> wrote in message news:FD23AB78-FF72-4F98-8546-ECDE6A434D68@microsoft.com... > Posts to several groups have yielded no answers yet. Perhaps this one has > a > more experienced readership. :,) > > Situation: (1) Application subscribes to events generated by a service, > via > Remoting and an event wrapper. Both are on the same machine. (2) LAN > cable > is disconnected from the machine. (3) App receives no more events! > However, > the remoting proxy is still active and the application can invoke methods > in > the service. The service reports an exception that "the connection has > been > forcibly closed" when it tries to raise the event to the app. > > Modified Situation: (1) LAN cable is disconnected from the machine. (2) > Application starts and subscribes as before. (3) LAN cable is connected. > (4) > LAN cable is disconnected. (5) NO PROBLEMS! > > For obvious reasons, having the user disconnect the LAN while they start > the > application is not an acceptable procedure. What can be done?
Is this on XP? The TCP stack isn't loaded if you don't have a cable connected for some gawd awful reason even if you have a network card. Since you are on the local PC, you can use the IpcClient/Server channels OR you can install (i think available on xp sp 2 or later, but maybe some other ones) the "loopback" network driver from add/remove programs. I think there's a KB article out there about this issue. -- Doug Semler, MCPD a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh). The answer is 42; DNRC o- Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?
[quoted text, click to view] "Doug Semler" <dougsemler@gmail.com> wrote in message news:eVJHJcfAIHA.5960@TK2MSFTNGP05.phx.gbl... > Since you are on the local PC, you can use the IpcClient/Server channels > OR you can install (i think available on xp sp 2 or later, but maybe some > other ones) the "loopback" network driver from add/remove programs. >
Add hardware that is.... Install Manually...Network Adapters...Microsoft...Microsoft Loopback Adapter -- Doug Semler, MCPD a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh). The answer is 42; DNRC o- Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?
[quoted text, click to view] "John W." <JohnW@discussions.microsoft.com> wrote in message news:4CAD250D-8EE3-4527-A14B-1A19CA6D2B17@microsoft.com... > Found a time slot to check it today (never would have found it without > your > updated directions!), and... > Rats! That wasn't the solution. >
Sorry...Google lookup DisableDHCPMediaSense...and follow the directions there. if that doesn't work, i'd suggest switching to IPCServer/Client communication when the remoting is on the local system (that way you don't require the TCP/IP stack....and it's much faster) -- Doug Semler, MCPD a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh). The answer is 42; DNRC o- Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?
[quoted text, click to view] "John W." <JohnW@discussions.microsoft.com> wrote in message news:AAFD652B-FCD4-49B8-8E1B-6C9256CEFBB8@microsoft.com... > Can't do the disable thing. This connection is one of several to > identical > services on other machines. I need to detect loss of connectivity to the > other servers, and recovery of those connections occurs flawlessly right > now. > I just need the localhost connection to either break both links (events > and > remoting proxy) or leave both links intact instead of breaking just one > and > leaving the one I use to detect the break. > > IPC may be the solution path, but there's a bunch of learning to be done > before I can go there, and then the localhost connection (and service?) > becomes unique. Ugh. >
Yeah I know. We actually redesigned our solution at one point to specficially avoid remoted events. Ingo Rammer's book has a good demonstration on how to do remoted events if you haven't already looked into that. Sorry, I would help you more but I had four teeth pulled today and am a bit out of it. If I htink of anything else over the weekend i'll post. -- Doug Semler, MCPD a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh). The answer is 42; DNRC o- Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?
I'm trying to understand IPC for this, but have run into two walls. (1) I built a mod of the IPC examples that resembles what we do and got it working in a variety of ways, but when I try to add events I get an error about something not being "allowed to be serialized at this level." Another variation dies with "the client doesn't have a sink channel...." (2) When I change the channel from TCP to IPC in my real apps, I get "Access denied" errors when the client app tries to connect with the server object. I suspect this is a higher-up cousin of the first of the above errors. I'm beginning to see why you abandoned the events. Wish I could. A MS support person suggested adding "bindto='127.0.0.1' " on the tcp channel creation, but that didn't help either. I smell an OS bug emerging. [quoted text, click to view] "Doug Semler" wrote: > Yeah I know. We actually redesigned our solution at one point to > specficially avoid remoted events. > > Ingo Rammer's book has a good demonstration on how to do remoted events if > you haven't already looked into that. > > -- > Doug Semler, MCPD > a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh). > The answer is 42; DNRC o- > Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira > erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg? >
[quoted text, click to view] "John W." <JohnW@discussions.microsoft.com> wrote in message news:532A55EB-4553-4F73-A066-3BD0201B7F52@microsoft.com... > I'm trying to understand IPC for this, but have run into two walls. > (1) I built a mod of the IPC examples that resembles what we do and got it > working in a variety of ways, but when I try to add events I get an error > about something not being "allowed to be serialized at this level." > Another > variation dies with "the client doesn't have a sink channel...." > (2) When I change the channel from TCP to IPC in my real apps, I get > "Access > denied" errors when the client app tries to connect with the server > object. > I suspect this is a higher-up cousin of the first of the above errors. > > I'm beginning to see why you abandoned the events. Wish I could. >
Two things real quick for your own lookup real quick (I'm too buzzed to respond properly and I may have these properties a little wrong but it could give you a good starting point) BinarySerialization (Level?) = Full on both the client AND server level serialization methods. This gets around type serialization issues. IPC communications in .NET 2 gives default access. On XP+ that means that CREATOR OWNER is the only one that is gonna be able to write to it. you can get around this by either specifying an authenticationLevel attribute name (i believe that's the name it may be slightly different....MSDN has the right one) to the user group of the IPC access. Or, if you are creating the IPC server/client by "hand" you should be able to specify the acces group. Remember, an IPC connection type is implemented as a named pipe, which means it follows the same DACL rules of named pupes. -- Doug Semler, MCPD a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh). The answer is 42; DNRC o- Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?
That helped. Between you and a MS tech, I have been successfull establishing more impervious connections using both IPC and a modified TCP (with bindTo and machineName). Both options work great between two test applications. They fail miserably, with the same connection loss, between the "real" application and the service. Maybe I'm close to a solution, and perhaps not. [quoted text, click to view] "Doug Semler" wrote: > BinarySerialization (Level?) = Full on both the client AND server level > serialization methods. This gets around type serialization issues. > > IPC communications in .NET 2 gives default access. On XP+ that means that > CREATOR OWNER is the only one that is gonna be able to write to it. you > can get around this by either specifying an authenticationLevel attribute > name (i believe that's the name it may be slightly different....MSDN has the > right one) to the user group of the IPC access. Or, if you are creating the > IPC server/client by "hand" you should be able to specify the acces group. > > Remember, an IPC connection type is implemented as a named pipe, which > means it follows the same DACL rules of named pipes. > > -- > Doug Semler, MCPD > a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh). > The answer is 42; DNRC o- > Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira > erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?
ANSWER: On the localhost machine, we have to use IPC. The callbacks channel had to be created in code, but the remoting proxy channel can be configured in the config file. A key piece was the attribute authorizedGroup="Everyone", required on both IPC channels. Since we have other identical remoting connections to other machines, a TrackingHandler was required to search the ChannelData when an object was being marshaled and remove the IPC channel from the list when the target is on a different machine. That is probably the most complicated part. The rest is very straightforward. /// <summary> /// The TrackingHandler is used for customizing a Remoting connection. /// This one removes references to any IPC channel unless the connecting /// object has been registered to allow an IPC connection. /// </summary> public class IpcTrackingHandler : ITrackingHandler { List<object> allowInIpcChannelList = new List<object>(); public void AllowThisInIpcChannel( object o ) { allowInIpcChannelList.Add(o); } // Called when the tracked object is marshaled. public void MarshaledObject( Object obj, ObjRef objRef ) { if (!allowInIpcChannelList.Contains(obj) && objRef.ChannelInfo != null) { List<object> replacementChannelData = new List<object>(); // Copy ChannelData except for any IPC store foreach (object data in objRef.ChannelInfo.ChannelData) { bool okToAdd = true; if (data is ChannelDataStore) { foreach (string uri in ((ChannelDataStore)data).ChannelUris) { if (uri.StartsWith("ipc")) { okToAdd = false; break; } } } if (okToAdd) replacementChannelData.Add(data); } objRef.ChannelInfo.ChannelData = replacementChannelData.ToArray(); } } // Called when the tracked object is unmarshaled. public void UnmarshaledObject( Object obj, ObjRef objRef ) { } // Called when the tracked object is disconnected. public void DisconnectedObject( Object obj ) { } }
"Doug Semler" <dougsemler@gmail.com> wrote in news:#yjh9KhAIHA.4844@TK2MSFTNGP02.phx.gbl: [quoted text, click to view] > Yeah I know. We actually redesigned our solution at one point to > specficially avoid remoted events. > > Ingo Rammer's book has a good demonstration on how to do remoted > events if you haven't already looked into that. > > Sorry, I would help you more but I had four teeth pulled today and am > a bit out of it. If I htink of anything else over the weekend i'll > post.
I used option #2: http://www.codeproject.com/csharp/RemotingAndEvents.asp
Don't see what you're looking for? Try a search.
|
|
|