您这个问题让人不知怎么回答,您可以问:
您需要获得那些信息?java.net.*;

解决方案 »

  1.   

    toString()方法可以得到一些地址信息
      

  2.   

    昨天在华储看到一本Java网络编程方面的书,比较适合你,好像是清华出的书,对于发出命令及返回的信息讲得比较多。要做ftp之类的工具可以看看。
      

  3.   

    楼上是说<JAVA网络程序设计>吧
    黄嘉辉的
    不错,开始我就是看这个的
    但是里面有的东西很繁琐的,总觉得可以跳过
    代码基本调通---除了个别的不是程序问题,是方法有点那个~~~
      

  4.   

    我顺便也问问,返回cgi的值摸?还有。返回http的值摸?
      

  5.   

    void bind(SocketAddress bindpoint) 
              Binds the socket to a local address. 
     void close() 
              Closes this socket. 
     void connect(SocketAddress endpoint) 
              Connects this socket to the server. 
     void connect(SocketAddress endpoint, int timeout) 
              Connects this socket to the server with a specified timeout value. 
     SocketChannel getChannel() 
              Returns the unique SocketChannel object associated with this socket, if any. 
     InetAddress getInetAddress() 
              Returns the address to which the socket is connected. 
     InputStream getInputStream() 
              Returns an input stream for this socket. 
     boolean getKeepAlive() 
              Tests if SO_KEEPALIVE is enabled. 
     InetAddress getLocalAddress() 
              Gets the local address to which the socket is bound. 
     int getLocalPort() 
              Returns the local port to which this socket is bound. 
     SocketAddress getLocalSocketAddress() 
              Returns the address of the endpoint this socket is bound to, or null if it is not bound yet. 
     boolean getOOBInline() 
              Tests if OOBINLINE is enabled. 
     OutputStream getOutputStream() 
              Returns an output stream for this socket. 
     int getPort() 
              Returns the remote port to which this socket is connected. 
     int getReceiveBufferSize() 
              Gets the value of the SO_RCVBUF option for this Socket, that is the buffer size used by the platform for input on this Socket. 
     SocketAddress getRemoteSocketAddress() 
              Returns the address of the endpoint this socket is connected to, or null if it is unconnected. 
     boolean getReuseAddress() 
              Tests if SO_REUSEADDR is enabled. 
     int getSendBufferSize() 
              Get value of the SO_SNDBUF option for this Socket, that is the buffer size used by the platform for output on this Socket. 
     int getSoLinger() 
              Returns setting for SO_LINGER. 
     int getSoTimeout() 
              Returns setting for SO_TIMEOUT. 
     boolean getTcpNoDelay() 
              Tests if TCP_NODELAY is enabled. 
     int getTrafficClass() 
              Gets traffic class or type-of-service in the IP header for packets sent from this Socket  
     boolean isBound() 
              Returns the binding state of the socket. 
     boolean isClosed() 
              Returns the closed state of the socket. 
     boolean isConnected() 
              Returns the connection state of the socket. 
     boolean isInputShutdown() 
              Returns wether the read-half of the socket connection is closed. 
     boolean isOutputShutdown() 
              Returns wether the write-half of the socket connection is closed. 
     void sendUrgentData(int data) 
              Send one byte of urgent data on the socket. 
     void setKeepAlive(boolean on) 
              Enable/disable SO_KEEPALIVE. 
     void setOOBInline(boolean on) 
              Enable/disable OOBINLINE (receipt of TCP urgent data) By default, this option is disabled and TCP urgent data received on a socket is silently discarded. 
     void setReceiveBufferSize(int size) 
              Sets the SO_RCVBUF option to the specified value for this Socket. 
     void setReuseAddress(boolean on) 
              Enable/disable the SO_REUSEADDR socket option. 
     void setSendBufferSize(int size) 
              Sets the SO_SNDBUF option to the specified value for this Socket. 
    static void setSocketImplFactory(SocketImplFactory fac) 
              Sets the client socket implementation factory for the application. 
     void setSoLinger(boolean on, int linger) 
              Enable/disable SO_LINGER with the specified linger time in seconds. 
     void setSoTimeout(int timeout) 
              Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. 
     void setTcpNoDelay(boolean on) 
              Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm). 
     void setTrafficClass(int tc) 
              Sets traffic class or type-of-service octet in the IP header for packets sent from this Socket. 
     void shutdownInput() 
              Places the input stream for this socket at "end of stream". 
     void shutdownOutput() 
              Disables the output stream for this socket. 
     String toString() 
              Converts this socket to a String.