X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Runtime.Remoting%2FSystem.Runtime.Remoting.Channels.Tcp%2FTcpClientTransportSink.cs;h=df0f08501bddd3c8a13dacc27262484deb372c26;hb=2ab02d99c44321dfc73fd10bee7a6fbf7016116b;hp=e31e286424eceebb7f8925418026a95c7f6cc825;hpb=3d693eeb90339833968d66c3dc9fde2fa3ba2cef;p=mono.git diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpClientTransportSink.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpClientTransportSink.cs index e31e286424e..df0f08501bd 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpClientTransportSink.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpClientTransportSink.cs @@ -45,7 +45,19 @@ namespace System.Runtime.Remoting.Channels.Tcp public TcpClientTransportSink (string url) { string objectUri; - _host = TcpChannel.ParseTcpURL (url, out objectUri, out _port); + string port; + + TcpChannel.ParseTcpURL (url, out _host, out port, out objectUri); + + try { + if (port != null) + _port = Convert.ToInt32 (port); + else + _port = 0; + } catch { + _host = null; + _port = -1; + } } public IDictionary Properties @@ -87,7 +99,11 @@ namespace System.Runtime.Remoting.Channels.Tcp if (!isOneWay) { sinkStack.Push (this, connection); - ThreadPool.QueueUserWorkItem (new WaitCallback(ReadAsyncTcpMessage), sinkStack); + ThreadPool.QueueUserWorkItem (new WaitCallback(data => { + try { + ReadAsyncTcpMessage (data); + } catch {} + }), sinkStack); } else connection.Release();