From f0bfb879798e87296e13063203d5b18a1aa1097f Mon Sep 17 00:00:00 2001 From: Johan Berntsson Date: Tue, 11 Mar 2008 04:40:39 +0000 Subject: Eliminated several compiler warning messages --- ThirdParty/3Di/LoadBalancer/TcpClient.cs | 7 ++++--- ThirdParty/3Di/LoadBalancer/TcpServer.cs | 18 ------------------ 2 files changed, 4 insertions(+), 21 deletions(-) (limited to 'ThirdParty/3Di/LoadBalancer') diff --git a/ThirdParty/3Di/LoadBalancer/TcpClient.cs b/ThirdParty/3Di/LoadBalancer/TcpClient.cs index 2e4cdc7..ab1f692 100644 --- a/ThirdParty/3Di/LoadBalancer/TcpClient.cs +++ b/ThirdParty/3Di/LoadBalancer/TcpClient.cs @@ -37,8 +37,6 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer { public class AsynchronousClient { private static ManualResetEvent connectDone = new ManualResetEvent(false); private static ManualResetEvent sendDone = new ManualResetEvent(false); - private static ManualResetEvent receiveDone = new ManualResetEvent(false); - private static String response = String.Empty; public static Socket StartClient(string hostname, int port) { try { @@ -114,7 +112,10 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer { try { Socket client = (Socket) ar.AsyncState; int bytesSent = client.EndSend(ar); - //Console.WriteLine("Sent {0} bytes to server.", bytesSent); + if(bytesSent > 0) + { + //Console.WriteLine("Sent {0} bytes to server.", bytesSent); + } sendDone.Set(); } catch (Exception e) { Console.WriteLine(e.ToString()); diff --git a/ThirdParty/3Di/LoadBalancer/TcpServer.cs b/ThirdParty/3Di/LoadBalancer/TcpServer.cs index 2d46294..216db3b 100644 --- a/ThirdParty/3Di/LoadBalancer/TcpServer.cs +++ b/ThirdParty/3Di/LoadBalancer/TcpServer.cs @@ -89,7 +89,6 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer { } public static void ReadCallback(IAsyncResult ar) { - String content = String.Empty; StateObject state = (StateObject) ar.AsyncState; Socket handler = state.workSocket; @@ -183,23 +182,6 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer { handler.BeginReceive( state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReadCallback), state); } - - private static void Send(Socket handler, String data) { - byte[] byteData = Encoding.ASCII.GetBytes(data); - handler.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), handler); - } - - private static void SendCallback(IAsyncResult ar) { - try { - Socket handler = (Socket) ar.AsyncState; - int bytesSent = handler.EndSend(ar); - //Console.WriteLine("Sent {0} bytes to client.", bytesSent); - handler.Shutdown(SocketShutdown.Both); - handler.Close(); - } catch (Exception e) { - Console.WriteLine(e.ToString()); - } - } } public class TcpServer { -- cgit v1.1