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()); }
public Server() { this.socket = Reactor.Udp.Socket.Create(); this.onsocket = socket => { }; this.sockets = new Dictionary <System.Net.EndPoint, Reactor.Fusion.Socket>(); }
public Server() { this.socket = Reactor.Udp.Socket.Create(); this.onsocket = socket => { }; this.sockets = new Dictionary<System.Net.EndPoint, Reactor.Fusion.Socket>(); }
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; }
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; }
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()); }