Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 07-27-2004
wodi wodi is offline
Registered User
 
 
Join Date: Feb 2003
Location: Duesseldorf, Germany
Posts: 13
Ice C# version 1.5 connect exception

Hi,

the following is a stack trace from Ice C# demo Hello in version 1.5.
The tests also throw this exception on the first checkedCast.
Any hints are welcome.
This is on Windows XP SP1 with the .NET runtime. The Alpha 2 version did not have any problems on this platform.

Client output:
Ice.ConnectFailedException: Connect failed ---> System.Net.Sockets.SocketException: Eine Verbindungsanforderung bezog sich auf einen bereits verbundenen Socket
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at IceInternal.Network.doConnect(Socket socket, EndPoint addr, Int32 timeout) in D:\Projects\icecs\Network.cs:line 366
--- End of inner exception stack trace ---
at IceInternal.ProxyFactory.checkRetryAfterException( LocalException ex, Int32 cnt) in D:\Projects\icecs\ProxyFactory.cs:line 104
at Ice.ObjectPrxHelperBase.__handleException(LocalExc eption ex, Int32 cnt) in D:\Projects\icecs\Proxy.cs:line 585
at Ice.ObjectPrxHelperBase.ice_isA(String __id, Context __context) in D:\Projects\icecs\Proxy.cs:line 104
at Ice.ObjectPrxHelperBase.ice_isA(String __id) in D:\Projects\icecs\Proxy.cs:line 84
at HelloPrxHelper.checkedCast(ObjectPrx b) in d:\projects\helloclient\helloclient\hello.cs:line 289
at Client.run(String[] args, Communicator communicator) in D:\Projects\HelloClient\Client.cs:line 43
at Client.Main(String[] args) in D:\Projects\HelloClient\Client.cs:line 156

Server Output:
HelloServer.exe: warning: connection exception:
Ice.ConnectionLostException: ConnectionLostException ---> System.Net.Sockets.SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at IceInternal.TcpTransceiver.read(BasicStream stream, Int32 timeout) in D:\Projects\icecs\TcpTransceiver.cs:line 185
--- End of inner exception stack trace ---
at IceInternal.TcpTransceiver.read(BasicStream stream, Int32 timeout) in D:\Projects\icecs\TcpTransceiver.cs:line 217
at IceInternal.Connection.read(BasicStream stream) in D:\Projects\icecs\Connection.cs:line 985
at IceInternal.ThreadPool.read(EventHandler handler) in D:\Projects\icecs\ThreadPool.cs:line 676
at IceInternal.ThreadPool.run(BasicStream stream) in D:\Projects\icecs\ThreadPool.cs:line 541
local address = 192.168.1.101:12345
remote address = 192.168.1.101:1158
HelloServer.exe: warning: connection exception:
Ice.ConnectionLostException: ConnectionLostException ---> System.Net.Sockets.SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at IceInternal.TcpTransceiver.read(BasicStream stream, Int32 timeout) in D:\Projects\icecs\TcpTransceiver.cs:line 185
--- End of inner exception stack trace ---
at IceInternal.TcpTransceiver.read(BasicStream stream, Int32 timeout) in D:\Projects\icecs\TcpTransceiver.cs:line 217
at IceInternal.Connection.read(BasicStream stream) in D:\Projects\icecs\Connection.cs:line 985
at IceInternal.ThreadPool.read(EventHandler handler) in D:\Projects\icecs\ThreadPool.cs:line 676
at IceInternal.ThreadPool.run(BasicStream stream) in D:\Projects\icecs\ThreadPool.cs:line 541
local address = 192.168.1.101:12345
remote address = 192.168.1.101:1157

Cheers,

Wodi

Last edited by wodi : 07-27-2004 at 11:19 AM.
Reply With Quote
  #2 (permalink)  
Old 07-27-2004
wodi wodi is offline
Registered User
 
 
Join Date: Feb 2003
Location: Duesseldorf, Germany
Posts: 13
Hi again,

ok, I found a solution:

disable in Network.cs the Mono fix

if(ready && !socket.Connected)
{
goto repeatConnect;
}

around line 404.

It will work then on Windows with .NET. Any explanation please!

Cheers,

Wodi

PS:

all tests complete successful on .NET after fixing Network.cs:

#if __MonoCS__
if(ready && !socket.Connected)
{
goto repeatConnect;
}
#endif

Last edited by wodi : 07-27-2004 at 12:37 PM.
Reply With Quote
  #3 (permalink)  
Old 07-27-2004
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 896
Quote:
Originally posted by wodi
disable in Network.cs the Mono fix

if(ready && !socket.Connected)
{
goto repeatConnect;
}

around line 404.

It will work then on Windows with .NET. Any explanation please!
Hi Wodi,

the problem is that, with Mono under Linux, there is a problem in the Connect() behavior: a select after a non-blocking connect returns a writable file descriptor (indicating that the connection is established) when, in fact, the connection is not established. Interestingly, restarting the call to select doesn't fix this (that is, the socket remains unconnected thereafter), but restarting the connect call does.

I tried this hack with .NET under Windows as well, and had no problems, which is why I left it enabled for both .NET and Mono.

Quote:

Code:
#if __MonoCS__		    
            if(ready && !socket.Connected)
           {
           goto repeatConnect;
           }
#endif
Ah, that isn't quite the correct fix. The problem with __MonoCS__ is that this is a compile-time test. So, if you compile something with mcs and then copy the binaries to a Windows machine with a .NET run time, it will still fail. One correct (simple) fix for now is to change the test to read:

Code:
if(ready && System.Type.GetType("Mono.Runtime") != null && !socket.Connected)
Thanks for the bug report, Wodi. This will be fixed for the next release, of course.

Cheers,

Michi.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[help]how to connect a server by ip? joise Help Center 5 06-30-2006 05:11 AM
the different between debug version and release version huaciom Help Center 1 04-05-2005 03:18 AM
How can I connect to MSSQL With ICE? victorchan Help Center 1 09-27-2004 09:48 AM
Connect failed HELP! alesio Help Center 1 02-24-2004 06:06 AM
::connect failure diddek Help Center 2 01-26-2004 02:01 PM


All times are GMT -4. The time now is 12:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.