Here you can find the source of createSocketAddress(String server)
public static SocketAddress createSocketAddress(String server)
//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 }