Here you can find the source of string2SocketAddress(final String addr)
public static SocketAddress string2SocketAddress(final String addr)
//package com.java2s; //License from project: Apache License import java.net.InetSocketAddress; import java.net.SocketAddress; public class Main { /**/*from ww w .j a va2 s.c o m*/ * IP:PORT */ public static SocketAddress string2SocketAddress(final String addr) { String[] s = addr.split(":"); return new InetSocketAddress(s[0], Integer.valueOf(s[1])); } }