diff options
author | gareth | 2007-04-21 17:36:03 +0000 |
---|---|---|
committer | gareth | 2007-04-21 17:36:03 +0000 |
commit | 1dfda8f7440122486a51f5353807571160106656 (patch) | |
tree | 5f5113a6b9bc765d5c161f61f2d93fdd490fe27b /OpenSim.Servers | |
parent | Part 1/2: Comments (other part will come later) (diff) | |
download | opensim-SC_OLD-1dfda8f7440122486a51f5353807571160106656.zip opensim-SC_OLD-1dfda8f7440122486a51f5353807571160106656.tar.gz opensim-SC_OLD-1dfda8f7440122486a51f5353807571160106656.tar.bz2 opensim-SC_OLD-1dfda8f7440122486a51f5353807571160106656.tar.xz |
Added OpenGridProtocol class - start of the new TCP-based intersim protocol, very basic skeleton
First commit since we lost JesseMalt - Dedicated to their memory
Diffstat (limited to 'OpenSim.Servers')
-rw-r--r-- | OpenSim.Servers/OpenGridProtocol.cs | 74 | ||||
-rw-r--r-- | OpenSim.Servers/OpenSim.Servers.dll.build | 99 |
2 files changed, 124 insertions, 49 deletions
diff --git a/OpenSim.Servers/OpenGridProtocol.cs b/OpenSim.Servers/OpenGridProtocol.cs new file mode 100644 index 0000000..8c91b9a --- /dev/null +++ b/OpenSim.Servers/OpenGridProtocol.cs | |||
@@ -0,0 +1,74 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Net; | ||
4 | using System.Net.Sockets; | ||
5 | using System.Text; | ||
6 | using System.Text.RegularExpressions; | ||
7 | using System.Threading; | ||
8 | using Nwc.XmlRpc; | ||
9 | using System.Collections; | ||
10 | |||
11 | namespace OpenSim.Servers | ||
12 | { | ||
13 | public class OpenGridProtocolServer | ||
14 | { | ||
15 | |||
16 | private Thread m_workerThread; | ||
17 | private TcpListener m_tcpListener; | ||
18 | private int m_port; | ||
19 | private ArrayList m_clients; | ||
20 | |||
21 | private class ClientHandler { | ||
22 | private Thread m_clientThread; | ||
23 | private TcpClient m_socketHandle; | ||
24 | |||
25 | public ClientHandler(TcpClient clientSocketHandle) { | ||
26 | m_socketHandle=clientSocketHandle; | ||
27 | m_clientThread = new Thread(new ThreadStart(DoWork)); | ||
28 | m_clientThread.IsBackground = true; | ||
29 | m_clientThread.Start(); | ||
30 | } | ||
31 | |||
32 | private void DoWork() { | ||
33 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: ClientHandler.DoWork() - Got new client"); | ||
34 | } | ||
35 | } | ||
36 | |||
37 | public OpenGridProtocolServer(int port) | ||
38 | { | ||
39 | m_port = port; | ||
40 | } | ||
41 | |||
42 | public void Start() | ||
43 | { | ||
44 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: Start() - Opening server socket"); | ||
45 | |||
46 | m_workerThread = new Thread(new ThreadStart(StartServerSocket)); | ||
47 | m_workerThread.IsBackground = true; | ||
48 | m_workerThread.Start(); | ||
49 | } | ||
50 | |||
51 | private void StartServerSocket() | ||
52 | { | ||
53 | try | ||
54 | { | ||
55 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: StartServerSocket() - Spawned main thread OK"); | ||
56 | |||
57 | |||
58 | m_tcpListener = new TcpListener(m_port); | ||
59 | m_tcpListener.Start(); | ||
60 | |||
61 | TcpClient sockethandle; | ||
62 | while (true) | ||
63 | { | ||
64 | sockethandle = m_tcpListener.AcceptTcpClient(); | ||
65 | m_clients.Add(new OpenGridProtocolServer.ClientHandler(sockethandle)); | ||
66 | } | ||
67 | } | ||
68 | catch (Exception e) | ||
69 | { | ||
70 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.Message); | ||
71 | } | ||
72 | } | ||
73 | } | ||
74 | } | ||
diff --git a/OpenSim.Servers/OpenSim.Servers.dll.build b/OpenSim.Servers/OpenSim.Servers.dll.build index 278018d..ee52a56 100644 --- a/OpenSim.Servers/OpenSim.Servers.dll.build +++ b/OpenSim.Servers/OpenSim.Servers.dll.build | |||
@@ -1,49 +1,50 @@ | |||
1 | <?xml version="1.0" ?> | 1 | <?xml version="1.0" ?> |
2 | <project name="OpenSim.Servers" default="build"> | 2 | <project name="OpenSim.Servers" default="build"> |
3 | <target name="build"> | 3 | <target name="build"> |
4 | <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> | 4 | <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> |
5 | <mkdir dir="${project::get-base-directory()}/${build.dir}" /> | 5 | <mkdir dir="${project::get-base-directory()}/${build.dir}" /> |
6 | <copy todir="${project::get-base-directory()}/${build.dir}"> | 6 | <copy todir="${project::get-base-directory()}/${build.dir}"> |
7 | <fileset basedir="${project::get-base-directory()}"> | 7 | <fileset basedir="${project::get-base-directory()}"> |
8 | </fileset> | 8 | </fileset> |
9 | </copy> | 9 | </copy> |
10 | <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> | 10 | <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> |
11 | <resources prefix="OpenSim.Servers" dynamicprefix="true" > | 11 | <resources prefix="OpenSim.Servers" dynamicprefix="true" > |
12 | </resources> | 12 | </resources> |
13 | <sources failonempty="true"> | 13 | <sources failonempty="true"> |
14 | <include name="BaseHttpServer.cs" /> | 14 | <include name="BaseHttpServer.cs" /> |
15 | <include name="BaseServer.cs" /> | 15 | <include name="BaseServer.cs" /> |
16 | <include name="IRestHandler.cs" /> | 16 | <include name="IRestHandler.cs" /> |
17 | <include name="LocalUserProfileManager.cs" /> | 17 | <include name="LocalUserProfileManager.cs" /> |
18 | <include name="LoginResponse.cs" /> | 18 | <include name="LoginResponse.cs" /> |
19 | <include name="LoginServer.cs" /> | 19 | <include name="LoginServer.cs" /> |
20 | <include name="XmlRpcMethod.cs" /> | 20 | <include name="OpenGridProtocol.cs" /> |
21 | </sources> | 21 | <include name="XmlRpcMethod.cs" /> |
22 | <references basedir="${project::get-base-directory()}"> | 22 | </sources> |
23 | <lib> | 23 | <references basedir="${project::get-base-directory()}"> |
24 | <include name="${project::get-base-directory()}" /> | 24 | <lib> |
25 | <include name="${project::get-base-directory()}/${build.dir}" /> | 25 | <include name="${project::get-base-directory()}" /> |
26 | </lib> | 26 | <include name="${project::get-base-directory()}/${build.dir}" /> |
27 | <include name="System.dll" /> | 27 | </lib> |
28 | <include name="System.Xml.dll" /> | 28 | <include name="System.dll" /> |
29 | <include name="../bin/OpenSim.Framework.dll" /> | 29 | <include name="System.Xml.dll" /> |
30 | <include name="../bin/OpenSim.Framework.Console.dll" /> | 30 | <include name="../bin/OpenSim.Framework.dll" /> |
31 | <include name="../bin/libsecondlife.dll" /> | 31 | <include name="../bin/OpenSim.Framework.Console.dll" /> |
32 | </references> | 32 | <include name="../bin/libsecondlife.dll" /> |
33 | </csc> | 33 | </references> |
34 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> | 34 | </csc> |
35 | <mkdir dir="${project::get-base-directory()}/../bin/"/> | 35 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> |
36 | <copy todir="${project::get-base-directory()}/../bin/"> | 36 | <mkdir dir="${project::get-base-directory()}/../bin/"/> |
37 | <fileset basedir="${project::get-base-directory()}/${build.dir}/" > | 37 | <copy todir="${project::get-base-directory()}/../bin/"> |
38 | <include name="*.dll"/> | 38 | <fileset basedir="${project::get-base-directory()}/${build.dir}/" > |
39 | <include name="*.exe"/> | 39 | <include name="*.dll"/> |
40 | </fileset> | 40 | <include name="*.exe"/> |
41 | </copy> | 41 | </fileset> |
42 | </target> | 42 | </copy> |
43 | <target name="clean"> | 43 | </target> |
44 | <delete dir="${bin.dir}" failonerror="false" /> | 44 | <target name="clean"> |
45 | <delete dir="${obj.dir}" failonerror="false" /> | 45 | <delete dir="${bin.dir}" failonerror="false" /> |
46 | </target> | 46 | <delete dir="${obj.dir}" failonerror="false" /> |
47 | <target name="doc" description="Creates documentation."> | 47 | </target> |
48 | </target> | 48 | <target name="doc" description="Creates documentation."> |
49 | </project> | 49 | </target> |
50 | </project> | ||