[Mono-list] Socket send/receive buffer sizes set incorrectly

Peter De Jager peterdj at telkomsa.net
Wed Aug 3 04:19:03 EDT 2005


When using Socket.SetSocketOption to set send/receive buffer sizes, the
actual buffer sizes are set to twice the values specified, e.g.:

// set send/receive buffer sizes
socket.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.SendBuffer, 8192);
socket.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveBuffer, 16384);

// display...
Console.WriteLine(socket.GetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.SendBuffer));
Console.WriteLine(socket.GetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveBuffer));

On Linux, this displays:
	16384
	32768
instead of:
	8192
	16384

Are socket options handled differently on Linux vs Windows?

Pete.



More information about the Mono-list mailing list