Exemple #1
0
        public Socket(System.Net.IPAddress address, int port)
        {
            this.OnConnect += () => { };

            this.OnData += data => { };

            this.OnError += error => { };

            this.OnEnd += () => { };

            this.sending = false;

            this.endpoint = new System.Net.IPEndPoint(address, port);

            this.socket = Reactor.Udp.Socket.Create();

            this.socket.Bind(System.Net.IPAddress.Any, 0);

            this.socket.OnMessage += (remote, data) => {
                if (remote.ToString() == this.endpoint.ToString())
                {
                    this.Receive(data);
                }
            };

            var syn = new Syn(Random.Get());

            this.socket.Send(this.endpoint, syn.Serialize());
        }
Exemple #2
0
        public Server()
        {
            this.socket = Reactor.Udp.Socket.Create();

            this.onsocket = socket => { };

            this.sockets = new Dictionary <System.Net.EndPoint, Reactor.Fusion.Socket>();
        }
Exemple #3
0
        public Server()
        {
            this.socket   = Reactor.Udp.Socket.Create();

            this.onsocket = socket => { };

            this.sockets = new Dictionary<System.Net.EndPoint, Reactor.Fusion.Socket>();
        }
Exemple #4
0
        public Socket(Reactor.Udp.Socket socket, System.Net.EndPoint endpoint)
        {
            this.OnConnect += ()    => { };

            this.OnData    += data  => { };

            this.OnError   += error => { };

            this.OnEnd     += ()    => { };

            this.sending    = false;

            this.socket     = socket;

            this.endpoint   = endpoint;
        }
Exemple #5
0
        public Socket(Reactor.Udp.Socket socket, System.Net.EndPoint endpoint)
        {
            this.OnConnect += () => { };

            this.OnData += data => { };

            this.OnError += error => { };

            this.OnEnd += () => { };

            this.sending = false;

            this.socket = socket;

            this.endpoint = endpoint;
        }
Exemple #6
0
        public Socket(System.Net.IPAddress address, int port)
        {
            this.OnConnect += ()    => { };

            this.OnData    += data  => { };

            this.OnError   += error => { };

            this.OnEnd     += ()    => { };

            this.sending    = false;

            this.endpoint   = new System.Net.IPEndPoint(address, port);

            this.socket     = Reactor.Udp.Socket.Create();

            this.socket.Bind(System.Net.IPAddress.Any, 0);

            this.socket.OnMessage += (remote, data) => {

                if (remote.ToString() == this.endpoint.ToString()) {

                    this.Receive(data);
                }
            };

            var syn = new Syn(Random.Get());

            this.socket.Send(this.endpoint, syn.Serialize());
        }