public synchronized NativeTcp registerIncomingTcpConnection(String originAddr,int originPort,String destAddr,int destPort){
  EndPointInfo origin=new EndPointInfo(originAddr,originPort,ConnectionType.TCP);
  EndPointInfo dest=new EndPointInfo(destAddr,destPort,ConnectionType.TCP);
  Queue<NativeTcp> queue=incomingConnections.get(dest);
  if (queue == null) {
    queue=new ConcurrentLinkedQueue<>();
    incomingConnections.put(dest,queue);
  }
  NativeTcp connection=new NativeTcp(dest,origin);
  queue.add(connection);
  return connection;
}

public synchronized NativeTcp registerIncomingTcpConnection ( String originAddr , int originPort , String destAddr , int destPort ) { EndPointInfo origin = new EndPointInfo ( originAddr , originPort , ConnectionType . TCP ) ; EndPointInfo dest = new EndPointInfo ( destAddr , destPort , ConnectionType . TCP ) ; Queue < NativeTcp > queue = incomingConnections . get ( dest ) ; if ( queue == null ) { queue = new ConcurrentLinkedQueue < > ( ) ; incomingConnections . put ( dest , queue ) ; } NativeTcp connection = new NativeTcp ( dest , origin ) ; queue . add ( connection ) ; return connection ; }
simulate an incoming connection . the connection is put on a buffer till the sut open a listening port
