all groups > dotnet remoting > december 2004 >
You're in the

dotnet remoting

group:

Please help! XP SP2 breaks remoting event callbacks


Re: Please help! XP SP2 breaks remoting event callbacks Sam Santiago
12/31/2004 10:33:35 AM
dotnet remoting:
SP2 turns on the firewall by default, so the first thing I would try is to
disable the firewall in SP2. Go to the Control Panel, Security Center to
disable the firewall.

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTechture.com
_______________________________
[quoted text, click to view]

Re: Please help! XP SP2 breaks remoting event callbacks Ken Kolda
12/31/2004 10:36:38 AM
This is caused by the Windows Firewall which is enabled in XP SP2 by
default. You need to disable the firewall or setup an exception for your
client executable. Alternatively, if you're looking to deploy this
application in an environment where you can't control the firewall settings,
consider using a third-party solution such as Genuine Channels
(www.genuinechannels.com) which uses a single, bidirectional TCP connection
for both client- and server-initiated messages.

Ken


[quoted text, click to view]

Re: Please help! XP SP2 breaks remoting event callbacks Ken Kolda
12/31/2004 12:39:18 PM
I know you said you've disabled the firewall, but your description of the
problem (especially the long timeout period) is exactly what you'd expect to
see when something if filtering packets between the client and server. So,
I'd double-check -- make sure there's no anti-virus that might be filtering
(e.g. Panda), no "network accelerators", etc.

Assuming there is no network issue, here are a few things to try/check:

1) In your client's code, do you register a TcpChannel or a
TcpClientChannel. If it's the latter, you need to switch to the former.

2) When you're invoking your delegates, try dumping the ObjRef for the
underlying object to disk/screen so you can see the IP address/port it's
trying to connect to. For example:

foreach (Delegate del in MessageArrived.GetInvocationList()) {
try {
mah = (MessageArrivedHandler) del;
ObjRef or = RemotingServices.GetObjRefForProxy(del.Target);
SoapFormatter fmt = new SoapFormatter();
using (FileStream fs = File.Create("C:\\objref.txt"))
fmt.Serialize(fs, or);
mah(msg);
}
catch (Exception e) {}

Open the objref.txt in Notepad and look at the ChannelData information (near
the bottom). You'll see the URL that the server is going to use to connect
back to the client, e.g. "tcp://198.126.1.104:1045/". Make sure the IP
address is correct. You can also try telnet'ing to that IP/port while the
client's running and see if you get a response.

Hope that helps -
Ken



[quoted text, click to view]

Please help! XP SP2 breaks remoting event callbacks Mike
12/31/2004 4:59:23 PM
Hi All,

I am developing an application based on Ingo Rammers sample in Chapter
6 of his book. Basically, I have a service which does some call
control and sends broadcasts to a number of clients by remoting via
events.
This all worked fine before I had an OS problem and I had to rebuild
my PC. I rebuilt it using the latest XP release with SP2 inlcuded and
now the events don't work. I can send remoting issues from the clients
to the server but the events are broken. When I try to raise the event
I get an exception after 50 seconds I get an exception. The same
application works fine on another XP machine which isn't running SP2.
The error below happens on this line:

foreach (Delegate del in MessageArrived.GetInvocationList()) {
try {
mah = (MessageArrivedHandler) del;
mah(msg); <-****Exception after 50 seconds
}
catch (Exception e) {}

{"A connection attempt failed because the connected party did not
properly respond after a period of time, or established connection
failed because connected host has failed to respond" }

StackTrace "\nServer stack trace: \n at
System.Net.Sockets.Socket.Connect(EndPoint remoteEP)\r\n at
System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()\r\n
at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()\r\n
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String
machineAndPort)\r\n at
System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage
msg, ITransportHeaders requestHeaders, Stream requestStream)\r\n at
System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage
msg, ITransportHeaders requestHeaders, Stream requestStream,
ITransportHeaders& responseHeaders, Stream& responseStream)\r\n at
System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage
msg)\n\nException rethrown at [0]: \n at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)\r\n at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)\r\n at
General.BroadcastEventWrapper.LocallyHandleMessageArrived(String msg)
in c:\\my documents\\visual studio
projects\\devstudio\\vs.net\\c#.net\\server.cs:line 49" string

Many thanks,

Re: Please help! XP SP2 breaks remoting event callbacks Mike
12/31/2004 7:40:07 PM
Hi, Sorry I should have said. I have disabled any firewalls. I am also
running client and server on the same machine for testing. I have
looked thorugh the newsgroups for similar problems but can;t find any
resolution. I have changed from HTTP\Soap to TCP\Binary to try but the
same problem. Also changed port numbers etc but no joy.

Any other ideas would be appreciated.

Many thanks,

Mike

On Fri, 31 Dec 2004 10:36:38 -0800, "Ken Kolda" <nospam@spam.com>
[quoted text, click to view]
Re: Please help! XP SP2 breaks remoting event callbacks Mike
12/31/2004 9:04:04 PM
Hi Ken,

Thanks again for your reply. Here is what I have in objref.txt:

From my machine with IP address of 192.168.1.99. I can see that the
ChannelDataStore value is totally wrong but I don't know why. I am
using app.config files which I have also included below.

*********Not Working********
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<a1:ObjRef id="ref-1"
xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting">
<uri
id="ref-2">/06ce3ab6_571f_43cf_b01e_648ba0ef3ee1/VvEySnfO_MpavkuRi1ASkmow_1.rem</uri>
<objrefFlags>1</objrefFlags>
<typeInfo href="#ref-3"/>
<envoyInfo xsi:null="1"/>
<channelInfo href="#ref-4"/>
</a1:ObjRef>
<a1:TypeInfo id="ref-3"
xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting">
<serverType id="ref-5">General.BroadcastEventWrapper, General,
Version=1.0.1826.32216, Culture=neutral,
PublicKeyToken=null</serverType>
<serverHierarchy xsi:null="1"/>
<interfacesImplemented xsi:null="1"/>
</a1:TypeInfo>
<a1:ChannelInfo id="ref-4"
xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting">
<channelData href="#ref-6"/>
</a1:ChannelInfo>
<SOAP-ENC:Array id="ref-6" SOAP-ENC:arrayType="xsd:anyType[2]">
<item href="#ref-7"/>
<item href="#ref-8"/>
</SOAP-ENC:Array>
<a3:CrossAppDomainData id="ref-7"
xmlns:a3="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting.Channels">
<_ContextID>1370224</_ContextID>
<_DomainID>1</_DomainID>
<_processGuid
id="ref-9">1fdbd24b_ed3d_404b_82c6_a99f2d93672c</_processGuid>
</a3:CrossAppDomainData>
<a3:ChannelDataStore id="ref-8"
xmlns:a3="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting.Channels">
<_channelURIs href="#ref-10"/>
<_extraData xsi:null="1"/>
</a3:ChannelDataStore>
<SOAP-ENC:Array id="ref-10" SOAP-ENC:arrayType="xsd:string[1]">
<item id="ref-11">tcp://0.1.0.5:3235</item>
</SOAP-ENC:Array>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


From a working machine. Client and Server on same machine. IP address
is 192.168.1.2

******Working - Without SP2************
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<a1:ObjRef id="ref-1"
xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting">
<uri
id="ref-2">/ddbd52b6_f250_4148_b452_822f7ccd47b5/Lqr_uZpmsWVttiCMFqx63Rqj_1.rem</uri>
<objrefFlags>1</objrefFlags>
<typeInfo href="#ref-3"/>
<envoyInfo xsi:null="1"/>
<channelInfo href="#ref-4"/>
</a1:ObjRef>
<a1:TypeInfo id="ref-3"
xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting">
<serverType id="ref-5">General.BroadcastEventWrapper, General,
Version=1.0.1826.32216, Culture=neutral,
PublicKeyToken=null</serverType>
<serverHierarchy xsi:null="1"/>
<interfacesImplemented xsi:null="1"/>
</a1:TypeInfo>
<a1:ChannelInfo id="ref-4"
xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting">
<channelData href="#ref-6"/>
</a1:ChannelInfo>
<SOAP-ENC:Array id="ref-6" SOAP-ENC:arrayType="xsd:anyType[2]">
<item href="#ref-7"/>
<item href="#ref-8"/>
</SOAP-ENC:Array>
<a3:CrossAppDomainData id="ref-7"
xmlns:a3="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting.Channels">
<_ContextID>1361304</_ContextID>
<_DomainID>1</_DomainID>
<_processGuid
id="ref-9">4867e1f5_62f7_4723_b936_da2a26fe8b28</_processGuid>
</a3:CrossAppDomainData>
<a3:ChannelDataStore id="ref-8"
xmlns:a3="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting.Channels">
<_channelURIs href="#ref-10"/>
<_extraData xsi:null="1"/>
</a3:ChannelDataStore>
<SOAP-ENC:Array id="ref-10" SOAP-ENC:arrayType="xsd:string[1]">
<item id="ref-11">tcp://192.168.1.2:2278</item>
</SOAP-ENC:Array>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

On Fri, 31 Dec 2004 12:39:18 -0800, "Ken Kolda" <nospam@spam.com>
[quoted text, click to view]

Config files being used:

******Server Config File*******
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="tcp" port="4555">
<serverProviders>
<provider ref="wsdl" />
<formatter ref="soap" typeFilterLevel="Full" />
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
<service>
<wellknown mode="Singleton" type="Server.Broadcaster,
ConsoleService" objectUri="Broadcaster.binary" />
</service>
</application>
</system.runtime.remoting>
</configuration>


*****Client Config File********
<configuration>
<system.runtime.remoting>
<application>

<channels>
<channel ref="tcp" port="0" />
</channels>

<client>
<wellknown type="General.IBroadcaster, General"
url="tcp://192.168.1.99:4555/Broadcaster.binary" />
</client>

</application>
</system.runtime.remoting>
</configuration>

Thanks again,

Mike
[quoted text, click to view]
Re: Please help! XP SP2 breaks remoting event callbacks Mike
1/1/2005 10:00:05 AM
Thanks Ken for all your help. Dumping the objref object pointed me in
the right direction. It turns out that it was binding to the wrong
address. SP2 seems to install another LAN connection which is used for
Microsoft TV? This appears first in the list and so gets sent with the
client. This is obviously not a standard routable interface and so I
never got the remoting callbacks. Used bindTo in the client app.config
file and all is well.

Thanks again,

Mike

On Fri, 31 Dec 2004 16:59:23 GMT, Mike <Mike@scrappy.freeserve.co.uk>
[quoted text, click to view]
Re: Please help! XP SP2 breaks remoting event callbacks Ken Kolda
1/3/2005 8:00:55 AM
I have no idea why you've got that bogus IP address in your ObjRef. However,
there is a way to work around this. In your client's and server's config
files, add a machineName property to the channel tag and set it to the
correct IP address of your machine (192.168.1.99). Here's more info on what
this attribute does and how to set it:

http://msdn.microsoft.com/library/en-us/cpguide/html/cpconconfiguration.asp

Good luck -
Ken


[quoted text, click to view]
id="ref-2">/06ce3ab6_571f_43cf_b01e_648ba0ef3ee1/VvEySnfO_MpavkuRi1ASkmow_1.
rem</uri>
[quoted text, click to view]
xmlns:a3="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting.Channe
ls">
[quoted text, click to view]
xmlns:a3="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting.Channe
ls">
[quoted text, click to view]
id="ref-2">/ddbd52b6_f250_4148_b452_822f7ccd47b5/Lqr_uZpmsWVttiCMFqx63Rqj_1.
rem</uri>
[quoted text, click to view]
xmlns:a3="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting.Channe
ls">
[quoted text, click to view]
xmlns:a3="http://schemas.microsoft.com/clr/ns/System.Runtime.Remoting.Channe
ls">
[quoted text, click to view]
Re: Please help! XP SP2 breaks remoting event callbacks Ken Kolda
1/3/2005 8:17:08 AM
I just say your other post where you identified the source of the problem.
Glad you were able to use bindTo to fix it.

Ken


[quoted text, click to view]
AddThis Social Bookmark Button