using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace EaseOfUse { class Program { static void Main() { // Load the DarkNet networking module mn.Start(1,0); // Start server mn.StartServer(0,50,0,3); // Display information about server Console.WriteLine("Local TCP IP: " + mn.GetLocalIPTCP(0)); Console.WriteLine("Local UDP IP: " + mn.GetLocalIPUDP(0)); Console.WriteLine("Local TCP Port: " + mn.GetLocalPortTCP(0)); Console.WriteLine("Local UDP Port: " + mn.GetLocalPortUDP(0)); Console.WriteLine(); // Create packet to store received data Int64 RecvPacket = mn.CreatePacket(); bool bRunning = true; while(bRunning == true) { // Check for new clients int iJoined = mn.ClientJoined(0); if (iJoined > 0) { Console.WriteLine("A new client joined the server"); } // Check for leaving clients int iLeft = mn.ClientLeft(0); if(iLeft > 0) { Console.WriteLine("A client left the server"); } for(int cl = 1; cl 0) { Console.WriteLine("UDP data received"); } // Check for new TCP data int iTCP = mn.RecvTCP(0,RecvPacket,cl); if(iTCP > 0) { Console.WriteLine("TCP data received"); } } } // Cleanup mn.Finish(-1); } } }