List of utility methods to do Socket Create
Socket | createSocket(String host, int port) create Socket return new Socket(host, port); |
void | createSocket(String[] hostPort) create Socket String address = hostPort[0];
Integer port = Integer.valueOf(hostPort[1]);
Socket s = new Socket(address, port);
s.close();
|
InetSocketAddress | createSocketAddr(String addr) create Socket Addr String[] splitted = addr.split(":"); return new InetSocketAddress(splitted[0], Integer.parseInt(splitted[1])); |
InetSocketAddress | createSocketAddr(String target) Util method to build socket addr from either: return createSocketAddr(target, null);
|
InetSocketAddress | createSocketAddr(String target) create Socket Addr return createSocketAddr(target, 8080);
|
SocketAddress | createSocketAddress() create Socket Address return new InetSocketAddress(HOST, PORT); |
SocketAddress | createSocketAddress(String server) create Socket Address String[] serverSplit = server.split(":"); String hostname = serverSplit[0]; int port = Integer.parseInt(serverSplit[1]); return new InetSocketAddress(hostname, port); |
InetSocketAddress | createSocketAddrForHost(String hostName, int port) create Socket Addr For Host return null;
|
ServerSocket | createSocketServer(int port) create socket server by default port return new ServerSocket(port); |
Socket | getSocket() Return the user socket return clientSocket;
|