↧
Answer by palacsint for Implementation of an asynchronous TCP/UDP server
1, Create (at least) two classes. One for UDP and one for TCP. It would omit lots of code like this:if (this.Type == ServerType.TCP) { ...} else if (this.Type == ServerType.UDP) { ...}Maybe a common...
View ArticleAnswer by Dan Lyons for Implementation of an asynchronous TCP/UDP server
At a quick glance, there are a couple minor things I noticed regarding how you handle your events:You are passing null event args. I would instead use EventArgs.Empty, as callers will typically assume...
View ArticleImplementation of an asynchronous TCP/UDP server
I am trying to implement a TCP/UDP server so all I have to do is something like this:var server = new Server(Type.UDP, "127.0.0.1", 8888);server.OnDataRecieved += Datahandler;server.Start();I have...
View Article