Exemple #1
0
 public RpcController(NetworkLevel2Controller network)
 {
     this.network = network;
     network.RegisterPacketConsumer(RpcType, new Level2ReceivedPacketHandler(network_ReceivedPacket));
     //network.ReceivedPacket += new Level2ReceivedPacketHandler(network_ReceivedPacket);
     //network.NetworkChangeState += new Level1NetworkChangeStateHandler( _NetworkChangeState );
     isserver = network.IsServer;
 }
Exemple #2
0
 public void Go()
 {
     net = new NetworkLevel2Controller();
     net.ListenAsServer(3456);
     net.NewConnection += new Level2NewConnectionHandler(net_NewConnection);
     net.Disconnection += new Level2DisconnectionHandler(net_Disconnection);
     net.RegisterPacketConsumer('Z', new Level2ReceivedPacketHandler(net_ReceivedPacket));
     //net.ReceivedPacket += new Level2ReceivedPacketHandler(net_ReceivedPacket);
     // net.ListenAsServer( 3457 );
     while (true)
     {
         net.Tick();
         Thread.Sleep(50);
     }
 }
Exemple #3
0
            public void Go()
            {
                net = new NetworkLevel2Controller();
                net.ConnectAsClient("127.0.0.1", 3456);

                net.NewConnection += new Level2NewConnectionHandler(net_NewConnection);
                net.Disconnection += new Level2DisconnectionHandler(net_Disconnection);
                net.RegisterPacketConsumer('Z', new Level2ReceivedPacketHandler(net_ReceivedPacket));
                //net.ReceivedPacket += new Level2ReceivedPacketHandler(net_ReceivedPacket);

                while (true)
                {
                    net.Tick();
                    //net.ConnectionToServer.Send( 'P', Encoding.ASCII.GetBytes( "sample data " + i.ToString() ) );
                    Thread.Sleep(50);
                //    i++;
                }
            }
Exemple #4
0
            public void Go()
            {
                net = new NetworkLevel2Controller();
                net.ConnectAsClient("127.0.0.1", 3456);

                net.NewConnection += new Level2NewConnectionHandler(net_NewConnection);
                net.Disconnection += new Level2DisconnectionHandler(net_Disconnection);
                net.RegisterPacketConsumer('Z', new Level2ReceivedPacketHandler(net_ReceivedPacket));
                //net.ReceivedPacket += new Level2ReceivedPacketHandler(net_ReceivedPacket);

                while (true)
                {
                    net.Tick();
                    //net.ConnectionToServer.Send( 'P', Encoding.ASCII.GetBytes( "sample data " + i.ToString() ) );
                    Thread.Sleep(50);
                    //    i++;
                }
            }
Exemple #5
0
 public void Go()
 {
     net = new NetworkLevel2Controller();
     net.ListenAsServer(3456);
     net.NewConnection += new Level2NewConnectionHandler(net_NewConnection);
     net.Disconnection += new Level2DisconnectionHandler(net_Disconnection);
     net.RegisterPacketConsumer('Z', new Level2ReceivedPacketHandler(net_ReceivedPacket));
     //net.ReceivedPacket += new Level2ReceivedPacketHandler(net_ReceivedPacket);
     // net.ListenAsServer( 3457 );
     while (true)
     {
         net.Tick();
         Thread.Sleep(50);
     }
 }