[Mono-dev] A couple of comm patches

Thad Thompson TThompson at Nucsafe.com
Tue Jan 5 14:58:58 EST 2010


Hi,
The native backend to the Socket implementation in Mono has fairly tight
checks on the protocol parameters handed to the low level socket. While
this catches problem early, it also prevents external extension of those
parameters. In my particular case, I'd like to access the Bluetooth
socket interface in Linux, but passing down an AddressFamily of
AF_BLUETOOTH gets caught in socket-io.c when it goes to convert the .NET
enum to the integer constant. One approach to solve this is to
re-implement a native socket interface, which is the approach taken by
the Monotooth project. However, I'd hate to give up the mature socket
handling classes and backend that Mono provides.    

To work around this, I'm submitting a patch which maps these values
through directly if they're not defined in the base framework. This
allows the use of the fully managed socket stack for writing against the
backend OS sockets. If the values passed down really are invalid, then
the consumer will catch a SocketException coming back from the OS
anyway. IMHO, there a bit more that could be trimmed, but I tried to
stay fairly conservative.

Also, the serial port speed is currently capped at 230400 baud. It would
be handy to be able to drive that a bit faster. Attached is a patch
which raises the cap to 460800.

Feedback welcome...

-Thad

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fast-serial.patch
Type: application/octet-stream
Size: 308 bytes
Desc: fast-serial.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100105/47f8218a/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: socket-io.patch
Type: application/octet-stream
Size: 2449 bytes
Desc: socket-io.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100105/47f8218a/attachment-0001.obj 


More information about the Mono-devel-list mailing list