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

Robert Jordan robertj at gmx.net
Mon Jul 25 10:26:43 EDT 2011

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:
> 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.


More information about the Mono-devel-list mailing list