摘要: ServerSocket類的構造方法有四種重載形式,它們的定義如下:
public ServerSocket() throws IOException
public ServerSocket(int port) throws IOException
public ServerSocket(int port, int backlog) throws IOException
public ServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException
在上面的構造方法中涉及到了三個參數:port、backlog和bindAddr。其中port是ServerSocket對象要綁定的端口,backlog是請求隊列的長度,bindAddr是ServerSocket對象要綁定的IP地址。
閱讀全文