Exemplo n.º 1
0
 public NetworkConnection createConnection() {
   InetSocketAddress address = getAddress();
   ConnectionEndpoint target = new ConnectionEndpoint(address);
   target.addProtocol(new ProtocolEndpointTCP(address));
   NetworkConnection conn =
       NetworkManager.getSingleton()
           .createConnection(
               target,
               new RawMessageEncoder(),
               new RawMessageDecoder(),
               false,
               false,
               new byte[0][0]);
   return new ListenedNetworkConnection(conn, this.getMonitoringListener(conn));
 }
  public ProtocolEndpointTCP(InetSocketAddress _address) {
    ce = new ConnectionEndpoint(_address);
    address = _address;

    ce.addProtocol(this);
  }
  public void setConnectionEndpoint(ConnectionEndpoint _ce) {
    ce = _ce;

    ce.addProtocol(this);
  }
  public ProtocolEndpointTCP(ConnectionEndpoint _ce, InetSocketAddress _address) {
    ce = _ce;
    address = _address;

    ce.addProtocol(this);
  }