Here you can find the source of stringAddressToSocketAddress(String address)
public static SocketAddress stringAddressToSocketAddress(String address)
//package com.java2s; //License from project: Apache License import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.Objects; public class Main { public static SocketAddress stringAddressToSocketAddress(String address) { Objects.requireNonNull(address); String[] strings = address.split(":"); return new InetSocketAddress(strings[0], Integer.valueOf(strings[1])); }/*from ww w . j a v a2s.c o m*/ }