Java Socket Address Get string2SocketAddress(final String addr)

Here you can find the source of string2SocketAddress(final String addr)

Description

IP:PORT

License

Apache License

Declaration

public static SocketAddress string2SocketAddress(final String addr) 

Method Source Code


//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]));
    }
}

Related

  1. parseSocketAddress(String anAddress)
  2. parseSocketAddress(String socketAddress)
  3. parseSocketAddressAddr(SocketAddress socketAddress)
  4. sizeOfInet(InetSocketAddress inet)
  5. socketAddress2String(final SocketAddress addr)
  6. stringAddressToSocketAddress(String address)
  7. stringifyInetSocketAddressList(InetSocketAddress[] addresses)
  8. stringToInetSocketAddress( String address, int defaultPort)
  9. toAddressString(InetSocketAddress address)