[Mono-dev] No local and remote endpoint for non-blocking connected socket

Michi Henning michi at zeroc.com
Tue Dec 18 15:16:22 EST 2007



as of Mono 1.2.6, when I call IPEndpoint.LocalEndPoint and 
IPEndpoint.RemoteEndpoint, I get
a null endpoint for a socket that was connected non-blocking. (Prior 
versions of Mono returned
the correct endpoints.)

I can work around this by using P/Invoke to call getpeername() and 
getsockname() to get
the local and remote endpoint. But what I don't like about this is that 
I have to use DllImport,
which hard-wires the libc path name into the code, but the C library 
tends to have different names
for different distributions.

So, what I'm looking for is a way to get the local and remote endpoint 
from a socket that was
connected non-blocking, but without having to use P/Invoke. If anyone 
has a suggestion, I'd
be most grateful.



More information about the Mono-devel-list mailing list