您这个问题让人不知怎么回答,您可以问:
您需要获得那些信息?java.net.*;
您需要获得那些信息?java.net.*;
解决方案 »
- 缓冲流问题 (ByteArrayInputStream/DataInputStream)
- equals() hashcode 方法同时重写问题
- 弱弱的问一下,java操作大文件的问题。
- 快帮看看啊!
- 怎样在java中识别tab键
- extends,emplements深层次的探讨
- 我是新手,问一下java获取系统时间的函数是什么?
- java applet程序中怎样实现图片的连续显示啊!!!
- 为什么我将TestArea设为只读后,滚动条就不能动了。
- 如何获取客户端当前域登录的用户名及密码?
- 万分火急,在线等待,要多少分给多少,关于JAVA与CORBA联合编程的一个问题
- 用什么方法来判断UDP传输数据报的完整性?
黄嘉辉的
不错,开始我就是看这个的
但是里面有的东西很繁琐的,总觉得可以跳过
代码基本调通---除了个别的不是程序问题,是方法有点那个~~~
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.