[Mono-list] ReceiveBufferSize & SendBufferSize properties on Socket

Narinder CLAIRE narinder.claire at uk.bnpparibas.com
Fri Nov 8 14:10:04 UTC 2013


Hi,
Recently when sending large quantity of data over the network to a C# recipient running on Mono (3.2.3 on Debian Wheezy) I  observed very degraded performance, close to unbearable.

I managed to pinpoint the offending lines in my code that gave arise to the poor performance.  The cause was the setting of the ReceiveBufferSize & SendBufferSize properties on the Socket and/or the TCPClient class.  Regardless of the values I tried to set, they would always be set to approx 2000 bytes, much smaller than the default values observed when not setting these properties at all.

I filed a bug   https://bugzilla.xamarin.com/show_bug.cgi?id=16021
I also saw this, I think related issue http://lists.ximian.com/pipermail/mono-list/2013-June/050008.html
Moreover I think this bug is also related : https://bugzilla.xamarin.com/show_bug.cgi?id=12754 (but I think the explanation is wrong)

But in summary my fix was to amend the code in /mono/metadata/socket-io.c

Original :

void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock,
gint32 level, gint32 name, MonoObject *obj_val, MonoArray *byte_val, gint32 int_val, gint32 *error)
{
    struct linger linger;
    int system_level;
    int system_name;
    int ret;

To :


void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock,

gint32 level, gint32 name, MonoObject *obj_val, MonoArray *byte_val, gint32 int_val_in, gint32 *error)

{

    struct linger linger;

    int system_level;

    int system_name;

    int ret;

    int int_val = int_val_in;





I hope the bug is fixed in the next version.





Regards

N


___________________________________________________________
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is prohibited.

Please refer to http://www.bnpparibas.co.uk/en/email-disclaimer/ for additional disclosures.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20131108/cc1a37a0/attachment.html>


More information about the Mono-list mailing list