コード例 #1
0
ファイル: SharedService.java プロジェクト: benjross/OneSwarm
 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));
 }
コード例 #2
0
  public ProtocolEndpointTCP(InetSocketAddress _address) {
    ce = new ConnectionEndpoint(_address);
    address = _address;

    ce.addProtocol(this);
  }
コード例 #3
0
  public void setConnectionEndpoint(ConnectionEndpoint _ce) {
    ce = _ce;

    ce.addProtocol(this);
  }
コード例 #4
0
  public ProtocolEndpointTCP(ConnectionEndpoint _ce, InetSocketAddress _address) {
    ce = _ce;
    address = _address;

    ce.addProtocol(this);
  }