[Mono-list] Socket and multiple threads

Jörg Rosenkranz joergr@voelcker.com
Thu, 17 Jul 2003 11:51:14 +0200


Hi all,

I have some problems with sockets and multiple threads:
Every time a program is communicating over one socket from different threads
I get following exception:

The socket has been shut down
in (unmanaged) /home/viadmin/mono-cvs/install/lib/libmono.so.0(mono_raise_exception+0x22) [0x400ab626]
in (unmanaged) /home/viadmin/mono-cvs/install/lib/libmono.so.0 [0x400ccd05]
in <0x000e8> 00 System.Net.Sockets.Socket:Send (byte[],int,int,System.Net.Sockets.SocketFlags)
in <0x00102> 00 System.Net.Sockets.Socket:Send (byte[],int,int,System.Net.Sockets.SocketFlags)
in <0x0001f> 00 System.Net.Sockets.Socket:Send (byte[],int,System.Net.Sockets.SocketFlags)

I noticed this behaviour using different components i.e. Mono SqlClient and a FTP component.
Access to the components is always exclusively locked to one thread at a time. So multiple threads
aren't accessing the socket simultaneously.

Are there any known problems with socket communication and multiple threads?

Thanks,
Joerg