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; }
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); } }
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++; } }