@Override public int getLocalPort() { return sock.getLocalPort(); }
public int getLocalPort() { if (this.socket != null) { return this.socket.getLocalPort(); } else { return -1; } }
public int getLocalPort() { if (this.socket != null) { return this.socket.getLocalPort(); } else { return -1; } }
/** * @return the local port of our {@link #socket} */ protected int getLocalPort() { return this.socket.getLocalPort(); }
public int getLocalPort() { return socket.getLocalPort(); }
private static int getUnusedPort() throws IOException { Socket s = new Socket(); s.bind( (SocketAddress) null ); int var1; try { var1 = s.getLocalPort(); } finally { s.close(); } return var1; }
/** * See {@link Socket#getLocalPort()}. Calling this method does not trigger mode detection. */ @Override public int getLocalPort() { return getSocketAllowUnknownMode().getLocalPort(); }
/** * @return pretty print of 'this' */ @Override public String toString() { return "" + (socket.isConnected() ? "tcp://" + socket.getInetAddress() + ":" + socket.getPort() + "@" + socket.getLocalPort() : (localLocation != null ? localLocation : remoteLocation)) ; }
protected String getSockAddress() { StringBuilder sb=new StringBuilder(); if(sock != null) { sb.append(sock.getLocalAddress().getHostAddress()).append(':').append(sock.getLocalPort()); sb.append(" - ").append(sock.getInetAddress().getHostAddress()).append(':').append(sock.getPort()); } return sb.toString(); }
int localPort = socket.getLocalPort();
public boolean finishConnect() throws IOException { if (channel.isConnectionPending()) { channel.finishConnect(); localPort = channel.socket().getLocalPort(); isFinishConnect = true; return true; } else { return false; } }
public FrontendConnection(SocketChannel channel) { super(channel); Socket socket = channel.socket(); this.host = socket.getInetAddress().getHostAddress(); this.port = socket.getPort(); this.localPort = socket.getLocalPort(); this.handler = new FrontendAuthenticator(this); }
public SocketAddress getLocalAddress() { final Socket socket = conduit.getSocketChannel().socket(); return new InetSocketAddress(socket.getLocalAddress(), socket.getLocalPort()); }
/** * Returns the local address and port of this socket as a SocketAddress or * null if the socket is unbound. This is useful on multihomed * hosts. */ public SocketAddress getLocalSocketAddress() { if (!isBound()) { return null; } return new InetSocketAddress(getLocalAddress(), getLocalPort()); }
@ManagedAttribute(description="The actual client_bind_port") public int getClientBindPortActual() {return ping_sock != null? ping_sock.getLocalPort() : 0;}
private String id(SocketChannel channel) { return channel.socket().getLocalAddress().getHostAddress() + ":" + channel.socket().getLocalPort() + "-" + channel.socket().getInetAddress().getHostAddress() + ":" + channel.socket().getPort(); }
public String toString() { Socket tmp_sock=sock; if(tmp_sock == null) return "<null socket>"; InetAddress local=tmp_sock.getLocalAddress(), remote=tmp_sock.getInetAddress(); String local_str=local != null? Util.shortName(local) : "<null>"; String remote_str=remote != null? Util.shortName(remote) : "<null>"; return String.format("%s:%s --> %s:%s (%d secs old) [%s] [recv_buf=%d]", local_str, tmp_sock.getLocalPort(), remote_str, tmp_sock.getPort(), TimeUnit.SECONDS.convert(getTimestamp() - last_access, TimeUnit.NANOSECONDS), status(), receiver != null? receiver.bufferSize() : 0); }
@Signature public Memory getLocalPort(Environment env, Memory... args) { return LongMemory.valueOf(socket.getLocalPort()); }
public Connection(Socket sock) throws Exception { this.sock=sock; peer_addr=new IpAddress((InetSocketAddress)sock.getRemoteSocketAddress()); in=new DataInputStream(createBufferedInputStream(sock.getInputStream())); out=new DataOutputStream(createBufferedOutputStream(sock.getOutputStream())); runner=new Runner(new DefaultThreadFactory("tcp", false, true), "conn-" + sock.getLocalPort(), this, null); }
return new InetSocketAddress(channel.socket().getLocalAddress(), channel.socket().getLocalPort()); } catch (IOException e) { throw new CanalClientException(e);