diff options
author | gareth | 2007-04-22 05:40:00 +0000 |
---|---|---|
committer | gareth | 2007-04-22 05:40:00 +0000 |
commit | b0dfd5602aa05a0a0a3c6adb6a982c52d1af7dda (patch) | |
tree | baccb14aac010c13b3781b8565e7303ca2f83970 /OpenSim.Servers | |
parent | Added some more good stuff to the new TCP skeleton (diff) | |
download | opensim-SC_OLD-b0dfd5602aa05a0a0a3c6adb6a982c52d1af7dda.zip opensim-SC_OLD-b0dfd5602aa05a0a0a3c6adb6a982c52d1af7dda.tar.gz opensim-SC_OLD-b0dfd5602aa05a0a0a3c6adb6a982c52d1af7dda.tar.bz2 opensim-SC_OLD-b0dfd5602aa05a0a0a3c6adb6a982c52d1af7dda.tar.xz |
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!
Diffstat (limited to 'OpenSim.Servers')
-rw-r--r-- | OpenSim.Servers/OpenGridProtocol.cs | 7 |
1 files changed, 6 insertions, 1 deletions
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 | |||
33 | 33 | ||
34 | private void DoWork() { | 34 | private void DoWork() { |
35 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: ClientHandler.DoWork() - Got new client"); | 35 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: ClientHandler.DoWork() - Got new client"); |
36 | this.WriteLine("OpenSim 0.1, running OGS protocol 1.0"); | ||
36 | 37 | ||
37 | } | 38 | } |
38 | 39 | ||
39 | private void WriteLine(string theline) { | 40 | private void WriteLine(string theline) { |
41 | theline+="\n"; | ||
40 | byte[] thelinebuffer = System.Text.Encoding.ASCII.GetBytes(theline.ToCharArray()); | 42 | byte[] thelinebuffer = System.Text.Encoding.ASCII.GetBytes(theline.ToCharArray()); |
41 | m_socketHandle.Send(thelinebuffer,theline.Length,0); | 43 | m_socketHandle.Send(thelinebuffer,theline.Length,0); |
42 | } | 44 | } |
@@ -51,6 +53,7 @@ namespace OpenSim.Servers | |||
51 | { | 53 | { |
52 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: Start() - Opening server socket"); | 54 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: Start() - Opening server socket"); |
53 | 55 | ||
56 | m_clients = new ArrayList(); | ||
54 | m_workerThread = new Thread(new ThreadStart(StartServerSocket)); | 57 | m_workerThread = new Thread(new ThreadStart(StartServerSocket)); |
55 | m_workerThread.IsBackground = true; | 58 | m_workerThread.IsBackground = true; |
56 | m_workerThread.Start(); | 59 | m_workerThread.Start(); |
@@ -72,7 +75,9 @@ namespace OpenSim.Servers | |||
72 | while (true) | 75 | while (true) |
73 | { | 76 | { |
74 | sockethandle = m_listenerSocket.Accept(); | 77 | sockethandle = m_listenerSocket.Accept(); |
75 | m_clients.Add(new OpenGridProtocolServer.ClientHandler(sockethandle)); | 78 | lock(m_clients.SyncRoot) { |
79 | m_clients.Add(new OpenGridProtocolServer.ClientHandler(sockethandle)); | ||
80 | } | ||
76 | } | 81 | } |
77 | } | 82 | } |
78 | catch (Exception e) | 83 | catch (Exception e) |