Ejemplo n.º 1
0
        public static void listen(string name, int port)
        {
            if (network != null) { // IDLE / DC state
                disconnect();
                return;
            }

            network = new Network(true);
            network.accept(port);
        }
Ejemplo n.º 2
0
        public static void connect(string name, string hostname, int port)
        {
            if (network != null) { // IDLE / DC state
                disconnect();
                return;
            }

            network = new Network();
            network.connect(hostname, port);
            network.sendPacket(Packet.NAME_PACKET, Utils.stringToBytes(name));
        }
Ejemplo n.º 3
0
 public static void disconnect()
 {
     network.disconnect();
     network = null;
 }