tcpuser.java

来自「一个小型网络仿真器的实现」· Java 代码 · 共 50 行

JAVA
50
字号
/*
   JaNetSim  ---  Java Network Simulator
   -------------------------------------

   This software was developed at the Network Research Lab, Faculty of
   Computer Science and Information Technology (FCSIT), University of Malaya.
   This software may be used and distributed freely. FCSIT assumes no responsibility
   whatsoever for its use by other parties, and makes no guarantees, expressed or
   implied, about its quality, reliability, or any other characteristic.

   We would appreciate acknowledgement if the software is used.

   FCSIT ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND
   DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING
   FROM THE USE OF THIS SOFTWARE.
*/

package janetsim.component;

public interface TCPUser {
  public static final int CON_RESET = 1;
  public static final int CON_REFUSED = 2;
  public static final int CON_ESTABLISHED = 3; //confirm a successful
                                               //3-way handshake for connection
                                               //establishment, where msg
                                               //will be an Object array containing
                                               //the other side's socket info:
                                               // (1st element) IP (Integer)
                                               // (2nd element) port (Integer)
                                               // (3rd element) link (SimComponent)
                                               //               (router/host interface)
  public static final int SENT_ACK = 4; //confirm a successful receive of the
                                        //sent buffer, where msg is an Integer
                                        //specifying the length of the buffer
                                        //acknowledged
  public static final int RECEIVE_BUF = 5; //receive a buffer from remote host,
                                           //msg is a java.util.List of TCPBuffer
  public static final int CON_CLOSED = 6; //indicate that the user close command
                                          //has been successful (cannot send
                                          //but can still receive)
  public static final int CON_CLOSING = 7; //indicate FIN received from the other
                                           //side
  public static final int CON_TIMEWAIT_TIMEOUT = 8; //indicate end of the TIMEWAIT
                                                    //state (really CLOSED)
                                                    //parameter is the socket's
                                                    //source port

  public void notify(int msg_id,Object msg);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?