Java Socket Create createSocketAddress(String server)

Here you can find the source of createSocketAddress(String server)

Description

create Socket Address

License

Apache License

Declaration

public static SocketAddress createSocketAddress(String server) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.InetSocketAddress;

import java.net.SocketAddress;

public class Main {
    public static SocketAddress createSocketAddress(String server) {
        String[] serverSplit = server.split(":");
        String hostname = serverSplit[0];
        int port = Integer.parseInt(serverSplit[1]);
        return new InetSocketAddress(hostname, port);
    }//w ww  . j  av a2  s .c o  m
}

Related

  1. createSocket(String[] hostPort)
  2. createSocketAddr(String addr)
  3. createSocketAddr(String target)
  4. createSocketAddr(String target)
  5. createSocketAddress()
  6. createSocketAddrForHost(String hostName, int port)
  7. createSocketServer(int port)
  8. getSocket()
  9. getSocket(String host, int port)