?????? Java ?У????? TCP Э?????????????????????????????? Socket ?????????????ServerSocket ??ServerSocket ?????????????? Server??????? accept()?????????????????????????
?????????
????ServerSocket ?г???????????????
    ????????ServerSocket(int port) ??????????????????????????????????IP???????????????????????????? IP ?????????? ????ServerSocket ????????
????Socket accept() ??????????????????????????п???????????????
????void close() ????? ServerSocket
????InetAddress getInetAddress() ???? ServerSocket ????????????? IP ???
????int getLocalPort() ???? ServerSocket ????????????? IP ?????????????
????int getSoTimeout();void setSoTimeout(int timeout) ???????????????е????????????TimeOut??
????String toString() ??????????????? ServerSocket ????????????? IP ??????????
????
????Socket ???г??????????????
????????????Socket(InetAddress address??int port) ?????????????????????? IP ?????????????????????????????????
????Socket(String host??int port) ???????÷????????????????????????????????????????
??????????
????void close??????????? Socket ????
????InetAddress getInetAddress() ???? Socket ?????????????????? IP ???
????InputStream getInputStream() ?????? Socket ????????
????OutputStream getOutStream() ?????? Socket ???????
????InetAddress getLocalAddress() ????? Socket ????????????? IP ???
????int getLocalPort() ????? Socket ????????????????
????int getPort() ????? Socket ?????????????????????
????int getSoTimeOut();void setSoTimeOut(int timeout) ???????????????е????????????
????String toString () ??????????????? Socket ?????????
 
????Socket ????????????????????
????public Socket(String host??int port)
????public Socket(InetAddress address??int port)
????public Socket(String host??int port??InetAddress localAddr??int localPort)
????public Socket(InetAddress host??int port?? InetAddress??localAddr??int localPort)
?????? JDK1.1 ?????Socket ????????? TCP/UDP ????
????public Socket(String host??int port??Boolean stream)
????public Socket(InetAddress host??int port?? Boolean stream)
????Socket ???????/???????????????·?????
????public InputStream getInputStream()
????public void shutdowmInput()
????public OutputStream get OutputStream ()
????public void shutdowmOutput()
??????????Щ??????????? IOException ??????????????????????
??????? Socket ????????
????public void close() throws IOException
????????/??? Socket ???????????
????public InetAddress getInetAddress()
????public int getPort()
????public void setSoTimeout(int timeout)
??????Щ??????????? SocketException ??????????????????????
????ServerSocket ????????????????????
????public ServerSocket (int Port)
????public ServerSocket (int Port??int backlog):???????????????
????public ServerSocket (int Port??int backlog??InetAddress bindAddr)
??????Щ??????????? IOException ??????????????????????
????public Socket accept():?????????????
????public void close():??? Socket
????????/??? Socket ??????????????
????public InetAddress get InetAddress ()
????public int getLocalPort()
????public void setSoTimeout(int timeout)
??????Щ??????????? SocketException ??????????????????????

????Socket ?????????
????1??????????
???????????????????????????????????????????????????????????????????????????????????????????綽??????——?????????????綽???????????????綽????????????????????
??????1???????????????????? ServerSocket ????????????????????????????
??????2???????????????????????????????? Socket ????????????????????????? host?????????????????port#??????????????????
??????3????????????? accept()????????????????????????????????????????????????????? I/O ????????
??????4???????????????????????????? InputStream ?? OutputStream ???е?????????????????????? Socket ????