예제 #1
0
파일: Socket.java 프로젝트: janfj/dd-wrt
  /**
   * If the socket is already connected this returns the remote SocketAddress, otherwise null
   *
   * @since 1.4
   */
  public SocketAddress getRemoteSocketAddress() {
    if (!isConnected()) return null;

    return new InetSocketAddress(impl.getInetAddress(), impl.getPort());
  }
예제 #2
0
파일: Socket.java 프로젝트: janfj/dd-wrt
 /**
  * Checks if the socket is connected
  *
  * @since 1.4
  */
 public boolean isConnected() {
   return impl.getInetAddress() != null;
 }
예제 #3
0
파일: Socket.java 프로젝트: janfj/dd-wrt
  /**
   * Returns the address of the remote end of the socket. If this socket is not connected, then
   * <code>null</code> is returned.
   *
   * @return The remote address this socket is connected to
   */
  public InetAddress getInetAddress() {
    if (impl != null) return impl.getInetAddress();

    return null;
  }