public class Socket extends Object
Modifier | Constructor and Description |
---|---|
protected |
Socket()
Socket
|
|
Socket(InetAddress locaddr,
int locport) |
|
Socket(InetAddress locaddr,
int locport,
boolean stream)
Deprecated.
Method Socket is deprecated
|
|
Socket(InetAddress locaddr,
int locport,
InetAddress remaddr,
int remport) |
protected |
Socket(SocketImpl socketimpl) |
|
Socket(String sLocalAddr,
int locport) |
|
Socket(String sLocalAddr,
int locport,
boolean stream) |
|
Socket(String sLocalAddr,
int locport,
InetAddress remaddr,
int remport) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
byte[] |
getCertificate() |
InetAddress |
getInetAddress() |
InputStream |
getInputStream() |
boolean |
getKeepAlive() |
InetAddress |
getLocalAddress() |
int |
getLocalPort() |
OutputStream |
getOutputStream() |
int |
getPort() |
int |
getSoLinger() |
int |
getSoTimeout() |
boolean |
getTcpNoDelay() |
void |
setKeepAlive(boolean flag) |
void |
setSecure(boolean negotiate) |
static void |
setSocketImplFactory(SocketImplFactory socketimplfactory) |
void |
setSoLinger(boolean flag,
int time) |
void |
setSoTimeout(int i) |
void |
setTcpNoDelay(boolean flag) |
String |
toString()
Returns a string representation of the object.
|
protected Socket()
public Socket(String sLocalAddr, int locport) throws UnknownHostException, IOException
sLocalAddr
- ?locport
- ?UnknownHostException
- ?IOException
- ?public Socket(String sLocalAddr, int locport, InetAddress remaddr, int remport) throws IOException
sLocalAddr
- ?locport
- ?remaddr
- ?remport
- ?IOException
- ?public Socket(String sLocalAddr, int locport, boolean stream) throws IOException
sLocalAddr
- ?locport
- ?stream
- ?IOException
- ?public Socket(InetAddress locaddr, int locport) throws IOException
locaddr
- ?locport
- ?IOException
- ?public Socket(InetAddress locaddr, int locport, InetAddress remaddr, int remport) throws IOException
locaddr
- ?locport
- ?remaddr
- ?remport
- ?IOException
- ?public Socket(InetAddress locaddr, int locport, boolean stream) throws IOException
locaddr
- ?stream
- ?locport
- ?IOException
- ?protected Socket(SocketImpl socketimpl) throws SocketException
socketimpl
- ?SocketException
- ?public void close() throws IOException
IOException
- ?public InetAddress getInetAddress()
public InputStream getInputStream() throws IOException
IOException
- ?public InetAddress getLocalAddress()
public int getLocalPort()
public byte[] getCertificate() throws SocketException
SocketException
public OutputStream getOutputStream() throws IOException
IOException
- ?public int getPort()
public int getSoTimeout() throws SocketException
SocketException
- ?public void setSoTimeout(int i) throws SocketException
i
- ?SocketException
- ?public void setSecure(boolean negotiate) throws SocketException
negotiate
- ?SocketException
- ?public int getSoLinger() throws SocketException
SocketException
- ?public void setSoLinger(boolean flag, int time) throws SocketException
flag
- ?time
- ?SocketException
- ?public boolean getTcpNoDelay() throws SocketException
SocketException
- ?public void setTcpNoDelay(boolean flag) throws SocketException
flag
- ?SocketException
- ?public boolean getKeepAlive() throws SocketException
SocketException
- ?public void setKeepAlive(boolean flag) throws SocketException
flag
- ?SocketException
- ?public static void setSocketImplFactory(SocketImplFactory socketimplfactory) throws IOException
socketimplfactory
- ?IOException
- ?public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object.