示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("WunderNet Test Client");
            string xmlPathDefault = @"D:\Documents\CodeProjects\WunderNet2\WunderServer\ExampleNet.xml";

            if (!System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows))
            {
                xmlPathDefault = @"/home/corey/Code/WunderNet2/WunderServer/ExampleNet.xml";
            }
            wc = new WunderTCPClient(xmlPathDefault, "localhost", 1234);
            wc.AddDataCallback("Message", ClientMessage);
            wc.Connect();

            Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            string xmlPathDefault = @"D:\Documents\CodeProjects\WunderNet2\WunderServer\ExampleNet.xml";

            if (!System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows))
            {
                xmlPathDefault = @"/home/corey/Code/WunderNet2/WunderServer/ExampleNet.xml";
            }
            ws = new WunderTCPServer(xmlPathDefault, IPAddress.Any, 1234);
            wc = new WunderTCPClient(xmlPathDefault, "localhost", 1234);

            ws.NewConnection += NewConnection;
            ws.AddDataCallback("Message", ServerMessage);
            ws.AddDataCallback("WorldInfo", ServerWorldInfo);
            ws.AcceptConnections();


            wc.AddDataCallback("Message", ClientMessage);
            wc.Connect();

            Console.ReadKey();
        }