Exemplo n.º 1
0
  public TCPSock(TCPManager tcpMan, SocketType type) {
    this.tcpMan = tcpMan;
    this.tsid = new TCPSockID();
    this.tsid.localAddr = tcpMan.getAddr();
    this.state = State.CLOSED;
    this.sockType = type;

    switch (sockType) {
      case SENDER:
        initSender();
        break;
      case RECEIVER:
        initReceiver();
        break;
      case WELCOME:
        initWelcome();
        break;
    }

    this.seqNum = 0;
  }