From b0dfd5602aa05a0a0a3c6adb6a982c52d1af7dda Mon Sep 17 00:00:00 2001 From: gareth Date: Sun, 22 Apr 2007 05:40:00 +0000 Subject: Now starts up a laggy (to be fixed) TCP server in grid mode and sends a banner NEED THREAD POOLS!!! DO NOT LET ME GET AWAY WITH BEING LAZY PEOPLE! --- OpenSim.Servers/OpenGridProtocol.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim.Servers/OpenGridProtocol.cs') diff --git a/OpenSim.Servers/OpenGridProtocol.cs b/OpenSim.Servers/OpenGridProtocol.cs index e3a7c3f..c3d7d5c 100644 --- a/OpenSim.Servers/OpenGridProtocol.cs +++ b/OpenSim.Servers/OpenGridProtocol.cs @@ -33,10 +33,12 @@ namespace OpenSim.Servers private void DoWork() { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: ClientHandler.DoWork() - Got new client"); + this.WriteLine("OpenSim 0.1, running OGS protocol 1.0"); } private void WriteLine(string theline) { + theline+="\n"; byte[] thelinebuffer = System.Text.Encoding.ASCII.GetBytes(theline.ToCharArray()); m_socketHandle.Send(thelinebuffer,theline.Length,0); } @@ -51,6 +53,7 @@ namespace OpenSim.Servers { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: Start() - Opening server socket"); + m_clients = new ArrayList(); m_workerThread = new Thread(new ThreadStart(StartServerSocket)); m_workerThread.IsBackground = true; m_workerThread.Start(); @@ -72,7 +75,9 @@ namespace OpenSim.Servers while (true) { sockethandle = m_listenerSocket.Accept(); - m_clients.Add(new OpenGridProtocolServer.ClientHandler(sockethandle)); + lock(m_clients.SyncRoot) { + m_clients.Add(new OpenGridProtocolServer.ClientHandler(sockethandle)); + } } } catch (Exception e) -- cgit v1.1