static void Main(string[] args) { SimpleTCP.SimpleTcpServer tcpServer = new SimpleTCP.SimpleTcpServer(); tcpServer.Start(51914); tcpServer.BroadcastLine("This is a broadcast"); tcpServer.DataReceived += HandleReceivedData; }
public void Start() { System.Net.IPAddress ipAddress = System.Net.IPAddress.Parse("127.0.0.1"); int port = 8910; Console.WriteLine("Starting Server on {0}:{1}", ipAddress, port); server.Start(ipAddress, port); if (server.IsStarted) { Console.WriteLine("Server started."); } else { Console.WriteLine("Server start failed."); } }