[Mono-devel-list] SocketException vs. RemotingException

Casper Hornstrup ch at csh-consult.dk
Sun Jul 31 13:46:49 EDT 2005


Hi.

When attempting to instanciate a remoting object which is not
available (i.e. no service is listening on the port), .NET 1.1
throws a SocketException while Mono 1.1 throws a RemotingException.


internal static bool IsResynchronizationEnabled()
{
	BaseRemoteIntegrationObject integrationObject = (BaseRemoteIntegrationObject)
		Activator.GetObject(typeof(BaseRemoteIntegrationObject),
		                    IntegrationManagerAccess.IntegrationManagerRemotingUrl);
	return integrationObject.IsResynchronizationEnabled();
}


private bool IsResynchronizationEnabled()
{
	try
	{
		return Global.IsResynchronizationEnabled();
	}
	catch (SocketException) /* .NET */
	{
		return false;
	}
	catch (System.Runtime.Remoting.RemotingException) /* Mono */
	{
		return false;
	}
}



Server error in '/' application

--------------------------------------------------------------------------------

Description: Error processing request. 
Error Message: HTTP 500. 

Stack Trace: System.Runtime.Remoting.RemotingException: Connection refused

Server stack trace: 
in <0x000b4> System.Runtime.Remoting.Channels.Tcp.HostConnectionPool:CreateConnection ()
in <0x00114> System.Runtime.Remoting.Channels.Tcp.HostConnectionPool:GetConnection ()
in <0x000fd> System.Runtime.Remoting.Channels.Tcp.TcpConnectionPool:GetConnection (System.String host, Int32 port)
in <0x00105> System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink:ProcessMessage (IMessage msg, ITransportHeaders
requestHeaders, System.IO.Stream requestStream, ITransportHeaders responseHeaders, System.IO.Stream responseStream)
in <0x0024b> System.Runtime.Remoting.Channels.BinaryClientFormatterSink:SyncProcessMessage (IMessage msg)

Exception rethrown at [0]: 

in <0x000b4> System.Runtime.Remoting.Channels.Tcp.HostConnectionPool:CreateConnection ()
in <0x00114> System.Runtime.Remoting.Channels.Tcp.HostConnectionPool:GetConnection ()
in <0x000fd> System.Runtime.Remoting.Channels.Tcp.TcpConnectionPool:GetConnection (System.String host, Int32 port)
in <0x00105> System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink:ProcessMessage (IMessage msg, ITransportHeaders
requestHeaders, System.IO.Stream requestStream, ITransportHeaders responseHeaders, System.IO.Stream responseStream)
in <0x0024b> System.Runtime.Remoting.Channels.BinaryClientFormatterSink:SyncProcessMessage (IMessage msg)

--------------------------------------------------------------------------------




More information about the Mono-devel-list mailing list