This class implements client implements client sockets( also called just "sockets"). A Socket is an endpoint for communication between two machines.
Constructor:
S.N. | Constructor & Description |
Socket() Creates an unconnected socket, with the system-default type of SocketImpl. | |
Socket(InetAddress address, int port) Creates a stream socket and connects it to the specified port number at the specified IP address. |
Methods:
S.N. | Methods with Description |
close() Closes this socket. | |
connect(SocketAddress endpoint) Connects this socket to the server. | |
getInetAddress() Returns the address to which the socket is connected. | |
getPort() Returns the remote port number to which this socket is connected. | |
isConnected() Returns the connection state of the socket. | |
getInputStream() returns the InputStream attached with this socket. | |
getOutputStream() returns the OutputStream attached with this socket. |