[Mono-dev] Non-TCP/IP socket access
Andy Hume
andyhume32 at yahoo.co.uk
Wed Jul 27 17:47:29 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.
>
> What we'd need is a platform dependent SocketAddress to
> sockaddr_storage mapping in the runtime.
>
OK. Please find a patch attached. :-) Works well for me. I think it's
as you foresaw; use of sockaddr_storage and all...
Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sockets 2011-07-27_1.patch
Type: application/octet-stream
Size: 1839 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110727/2c5f852b/attachment.obj
More information about the Mono-devel-list
mailing list