[Mono-list] Re: [Mono-devel-list] SCI Sockets

Jonathan Pryor jonpryor@vt.edu
Sat, 26 Mar 2005 09:45:02 -0500


On Sat, 2005-03-26 at 10:21 +0300, Vadim B. Guzev wrote:
> So, my question is: Is it possible to create additional flag AF_SCI in
> AdressFamily in order to use it in the following way:
> 
> Socket s = new Socket( AddressFamily.AF_SCI, ... );
> ... // The usage of this type of sockets is the same as usual

It is unlikely that this would be supported, as standard policy is to
only add extensions in Mono.* namespaces.

This doesn't mean you're up the creek, though.  There are a number of
places where we've had to extend the existing API where using a Mono.*
namespace was unacceptable, such as System.Reflection.Emit and
System.PlatformID.

In the case of enumerations (PlatformID), we've specified an internal
value that isn't part of the enumeration; for example, `(PlatformID)128'
is returned on *nix systems (at least until .NET 2.0, which adds a Unix
value).

It should be possible to do a similar trick with AddressFamily, using a
non-public value which isn't likely to be used in the future which the
Mono runtime can look for:

	Socket s = new Socket ((AddressFamily) 0xDEADBEEF, ...);

This would fail on .NET with an ArgumentException, but would work under
Mono (assuming that Mono supported the extended 0xDEADBEEF family).

 - Jon