aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs
diff options
context:
space:
mode:
authorJeff Ames2008-03-04 04:11:37 +0000
committerJeff Ames2008-03-04 04:11:37 +0000
commitcd6f4a57e7586ffd5c6dae91633e61e293272def (patch)
tree880c9199b13ae75e428c878f5857f9cef886cf73 /OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs
parentthink I finally fixed this hg sync issue (diff)
downloadopensim-SC-cd6f4a57e7586ffd5c6dae91633e61e293272def.zip
opensim-SC-cd6f4a57e7586ffd5c6dae91633e61e293272def.tar.gz
opensim-SC-cd6f4a57e7586ffd5c6dae91633e61e293272def.tar.bz2
opensim-SC-cd6f4a57e7586ffd5c6dae91633e61e293272def.tar.xz
Added copyright heaaders. Minor cleanup.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs18
1 files changed, 4 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs
index 1fd7a25..236b685 100644
--- a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs
+++ b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs
@@ -1,4 +1,4 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
@@ -37,21 +37,19 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC
37{ 37{
38 public class TCPClient : TCPCommon.ClientInterface 38 public class TCPClient : TCPCommon.ClientInterface
39 { 39 {
40
41 public TCPClient() 40 public TCPClient()
42 { 41 {
43 } 42 }
43
44 private readonly Dictionary<int, TCPSocket> Clients = new Dictionary<int, TCPSocket>(); 44 private readonly Dictionary<int, TCPSocket> Clients = new Dictionary<int, TCPSocket>();
45 private int ClientCount = 0; 45 private int ClientCount = 0;
46 46
47
48 public event TCPCommon.ClientConnectedDelegate ClientConnected; 47 public event TCPCommon.ClientConnectedDelegate ClientConnected;
49 public event TCPCommon.DataReceivedDelegate DataReceived; 48 public event TCPCommon.DataReceivedDelegate DataReceived;
50 public event TCPCommon.DataSentDelegate DataSent; 49 public event TCPCommon.DataSentDelegate DataSent;
51 public event TCPCommon.CloseDelegate Close; 50 public event TCPCommon.CloseDelegate Close;
52 public event TCPCommon.ConnectErrorDelegate ConnectError; 51 public event TCPCommon.ConnectErrorDelegate ConnectError;
53 52
54
55 /// <summary> 53 /// <summary>
56 /// Creates client connection 54 /// Creates client connection
57 /// </summary> 55 /// </summary>
@@ -62,6 +60,7 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC
62 //newsock.BeginConnect(ipe, new AsyncCallback(asyncConnected), newsock); 60 //newsock.BeginConnect(ipe, new AsyncCallback(asyncConnected), newsock);
63 newsock.Connect(ipe); 61 newsock.Connect(ipe);
64 } 62 }
63
65 public int ConnectAndReturnID(string RemoteHost, int RemotePort) 64 public int ConnectAndReturnID(string RemoteHost, int RemotePort)
66 { 65 {
67 Socket newsock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); 66 Socket newsock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
@@ -71,7 +70,6 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC
71 return ProcessConnection(newsock); 70 return ProcessConnection(newsock);
72 } 71 }
73 72
74
75 public void Disconnect(int ID) 73 public void Disconnect(int ID)
76 { 74 {
77 Clients[ID].Disconnect(); 75 Clients[ID].Disconnect();
@@ -88,9 +86,6 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC
88 { 86 {
89 try 87 try
90 { 88 {
91
92
93
94 int id = ClientCount++; 89 int id = ClientCount++;
95 TCPSocket S = new TCPSocket(id, client); 90 TCPSocket S = new TCPSocket(id, client);
96 91
@@ -121,9 +116,6 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC
121 return -1; 116 return -1;
122 } 117 }
123 118
124
125
126
127 void S_DataSent(int ID, int length) 119 void S_DataSent(int ID, int length)
128 { 120 {
129 if (DataSent != null) 121 if (DataSent != null)
@@ -147,7 +139,5 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC
147 { 139 {
148 Clients[clientID].Send(clientID, data, offset, len); 140 Clients[clientID].Send(clientID, data, offset, len);
149 } 141 }
150
151
152 } 142 }
153} \ No newline at end of file 143}