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

Andy Hume andyhume32 at yahoo.co.uk
Fri Jul 22 11:05:00 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: 22 July 2011 14:41
> To: mono-devel-list at lists.ximian.com
> Subject: Re: [Mono-dev] Non-TCP/IP socket access
> 
> On 22.07.2011 15:00, Andy Hume wrote:
> >> From: mono-devel-list-bounces at lists.ximian.com
> >> [mailto:mono-devel-list-bounces at lists.ximian.com] On 
> Behalf Of Robert 
> >> Jordan
> >> Sent: 22 July 2011 12:43
> >> To: mono-devel-list at lists.ximian.com
> >> Subject: Re: [Mono-dev] Non-TCP/IP socket access
> >>
> >> On 22.07.2011 13:08, Andy Hume wrote:
> >>> Presumably I can't convert my fd to a wapi handle 
> somehow...  So is 
> >>> that plan not going to work? :-,(
[...]
> > All I need is that wapi handle...[2]  Do we think it's 
> impossible to 
> > access it.
> 
> It looks like you could be able to create the socket with 
> io-layers's function:
> 
> [DllImport("__Internal")]
> static extern int _wapi_socket(int domain, int type,
>    int protocol, IntPtr unused1, int unused2, int unused3);
> 
> Then assign the returned descriptor via reflection.
> 
> I'll be shot for this one day ;)
>
That was the most beautiful ugly thing I've seen in a long time. :-)

Unfortunately I haven't managed to get it to work:
1) Try [DllImport("__Internal")] extern int _wapi_socket(..)
Swallowed Exception: System.EntryPointNotFoundException: _wapi_socket

2) Try [DllImport("mono-2.0")] extern int _wapi_socket(..)
Swallowed Exception: System.EntryPointNotFoundException: _wapi_socket

Even with some nm-ing I'm not sure where it is exported...  Ohh so
close...

Andy



More information about the Mono-devel-list mailing list