[Mono-dev] Non-TCP/IP socket access

Andy Hume andyhume32 at yahoo.co.uk
Tue Jul 26 14:05:19 EDT 2011


> -----Original Message-----
> From: mono-devel-list-bounces at lists.ximian.com 
> [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf 
> Of Robert Jordan
> Sent: 25 July 2011 15:27
> To: mono-devel-list at lists.ximian.com
> Subject: Re: [Mono-dev] Non-TCP/IP socket access
> 
> On 25.07.2011 15:24, Andy Hume wrote:
> 
> > Currently other socket types are blocked.  This occurs because the 
> > mapping functions will return an error if asked to handle a 
> different 
> > address family.  For instance see convert_family at 
> > mono/metadata/socket-io.c[3], when given an unknown value 
> will skip it 
> > and return -1, similarly for the other direction 
> > convert_to_mono_family returns AddressFamily_Unknown.  For 
> Connect and 
> > Bind, they use create_sockaddr_from_object which for an 
> unknown family returns:
> > 		*error = WSAEAFNOSUPPORT;
> >
> > Hence why I can't use Socket directly currently. :-,(
> 
> They are really blocked on purpose, but this is not set in stone.
> 
> You could, for example, provide patches that, for unknown 
> (but not limited to) AFs, simply assume that the specified 
> sockaddr is of the generic type "struct sockaddr_storage"
> (see RFC 2553). All Unixes (including OSX) and even Windows 
> support this type.
> 
OK sounds like a good plan.  I'll go and work on that and get back to
you. :-)

> What we'd need is a platform dependent SocketAddress to 
> sockaddr_storage mapping in the runtime.
> 

Andy



More information about the Mono-devel-list mailing list