[Mono-list] SocketOptionName.NoDelay question

Carlos Guzman Alvarez carlosga@telefonica.net
Thu, 28 Aug 2003 23:34:44 +0200


Hello:

I'm making some test with the new version of my Firebird .NET Data 
provider with mono on linux and i'm having one problem with socket 
connection, if i disable the Nagle algorithm ( SocketOptionName.NoDelay 
) of the socket i can't connect but if i comment this code i can connect 
ok, is this the correct behavior ??, this is working ok with Windows and 
MS.NET but i'm not sure if this can be an OS related issue.


Here is a code snippet:

IPAddress hostadd = Dns.Resolve(parameters.Server).AddressList[0];
IPEndPoint EPhost = new IPEndPoint(hostadd, parameters.Port);

socket = new Socket(AddressFamily.InterNetwork,
	SocketType.Stream,
	ProtocolType.IP);

// Set Receive Buffer size.
socket.SetSocketOption(SocketOptionLevel.Socket,
	SocketOptionName.ReceiveBuffer, parameters.PacketSize);

// Set Send Buffer size.
				socket.SetSocketOption(SocketOptionLevel.Socket,
	SocketOptionName.SendBuffer, parameters.PacketSize);
				
// Disables the Nagle algorithm for send coalescing.
socket.SetSocketOption(SocketOptionLevel.Socket,
	SocketOptionName.NoDelay, 1);

// Make the socket to connect to the Server
socket.Connect(EPhost);




-- 
Best regards

Carlos Guzmán Álvarez
Vigo-Spain