aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/TRPC/TCPCommon.cs
blob: 36a13e3252c579cbb7edcf8ae50b5504cd13069c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
namespace OpenSim.Region.ScriptEngine.Common.TRPC
{
    public class TCPCommon
    {
        public delegate void ClientConnectedDelegate(int ID, System.Net.EndPoint Remote);
        public delegate void DataReceivedDelegate(int ID, byte[] data, int offset, int length);
        public delegate void DataSentDelegate(int ID, int length);
        public delegate void CloseDelegate(int ID);
        public delegate void ConnectErrorDelegate(string Reason);


        public interface ServerAndClientInterface
        {
            void Send(int clientID, byte[] data, int offset, int len);
            event ClientConnectedDelegate ClientConnected;
            event DataReceivedDelegate DataReceived;
            event DataSentDelegate DataSent;
            event CloseDelegate Close;
        }
        public interface ClientInterface : ServerAndClientInterface
        {
            event TCPCommon.ConnectErrorDelegate ConnectError;
            void Connect(string RemoteHost, int RemotePort);
            void Disconnect(int ID);
        }
        public interface ServerInterface : ServerAndClientInterface
        {
            void StartListen();
            void StopListen();
        }

    }
}