Updates and returns the {@code TCP_INFO} for the current socket.
See <a href="http://linux.die.net/man/7/tcp">man 7 tcp</a>.
543858
public EpollTcpInfo tcpInfo(EpollTcpInfo info) {
        try {
            socket.getTcpInfo(info);
            return info;
        } catch (IOException e) {
            throw new ChannelException(e);
        }
    }
709733
@Override
    public String getConnectionInfo() {
        return String.format("Table Name - %s : Attribute Name - %s : Consistent Read - %b",
                this.config.getTableName(),
                this.config.getAttributeName(),
                this.config.consistentRead());
    }
858147
public static HttpServer<ByteBuf, ByteBuf> newServer(SocketAddress socketAddress) {
        return _newServer(TcpServer.newServer(socketAddress));
    }
479397
public void updateStatus() {

    String hostaddr = null;
    try {
      hostaddr = InetAddress.getByName(ip).getHostAddress();
    } catch (UnknownHostException e) {
      online = false;
      latency = Long.MAX_VALUE;
      return;
    }

    int total = 0;
    long totalPing = 0;

    // test ping 4 times
    int times = 4;

    while (total < times) {
      total++;
      long start = System.currentTimeMillis();

      SocketAddress sockaddr = new InetSocketAddress(hostaddr, port);
      try (Socket socket = new Socket()) {
        socket.connect(sockaddr, 1000);
      } catch (Exception e) {
        online = false;
        return;
      }

      totalPing += (System.currentTimeMillis() - start);
    }

    online = true;
    latency = totalPing / total;
  }
1311535
private void updateConnecting() throws IOException
    {
        if (clientId == -1)
        {
            // Receive id
            clientId = in.readByte();
            // Send the name
            out.writeByte(NetworkMessageSystemId.CONNECTING);
            out.writeByte(clientId);
            final byte[] data = clientName.getBytes(NetworkMessage.CHARSET);
            out.writeByte(data.length);
            out.write(data);
            out.flush();
            Verbose.info("Client: Performing connection to the server...");
        }
    }
1354716
async def get_update_info(self, from_network=True) -> SoftwareUpdateInfo:
        """"""
        if from_network:
            from_network = "true"
        else:
            from_network = "false"
        # from_network = ""
        info = await self.services["system"]["getSWUpdateInfo"](network=from_network)
        return SoftwareUpdateInfo.make(**info)
932237
public final String getHostAddress()
	{
		final Socket socket = s;
		return socket == null ? "" : socket.getInetAddress().getHostAddress();
	}
160848
private Packet addTcpdumpInfoToPacket(Packet parsedPacket){ 

        int packetSize = parsedPacket.getPacketSize();
        
        tcpdumpReader.readNewPacket(packetSize);

        // Get Tcp Payload
        if ( parsedPacket.isTcp() ) {       
            int payloadSize = parsedPacket.getTcpPayloadSize();
            int payloadStart = parsedPacket.getTcpPayloadStart();
            parsedPacket.setTcpPayload(tcpdumpReader.getPayload(payloadStart, payloadSize));
        }
        
        tcpdumpReader.packetReadComplete();
        
        return parsedPacket;
    }
648009
def _check_with_socket(self, sock_info):
        
        start = _time()
        try:
            return (sock_info.ismaster(self._pool.opts.metadata,
                                       self._topology.max_cluster_time()),
                    _time() - start)
        except OperationFailure as exc:
            # Update max cluster time even when isMaster fails.
            self._topology.receive_cluster_time(
                exc.details.get('$clusterTime'))
            raise
1352931
def return_socket(self, sock_info):
        """"""
        if self.pid != os.getpid():
            self.reset()
        else:
            if sock_info.pool_id != self.pool_id:
                sock_info.close()
            elif not sock_info.closed:
                sock_info.last_checkin = _time()
                with self.lock:
                    self.sockets.add(sock_info)

        self._socket_semaphore.release()
        with self.lock:
            self.active_sockets -= 1
39220
def get_sockinfo (host, port=None):
    """"""
    family, socktype = socket.AF_INET, socket.SOCK_STREAM
    return socket.getaddrinfo(host, port, family, socktype)
294513
def get_server_info(self):
        
        # NB: can't do it this way due to recursion
        # codec = self._get_codec(ttb_supported=False)
        codec = PbufCodec()
        msg = Msg(riak.pb.messages.MSG_CODE_GET_SERVER_INFO_REQ, None,
                  riak.pb.messages.MSG_CODE_GET_SERVER_INFO_RESP)
        resp_code, resp = self._request(msg, codec)
        return codec.decode_get_server_info(resp)
435625
public static function getProtocolInformation()
    {
        if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {
            return 'SERVER_PORT=443';
        }

        if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') {
            return 'X-Forwarded-Proto';
        }

        if (isset($_SERVER['HTTP_X_FORWARDED_SCHEME']) && strtolower($_SERVER['HTTP_X_FORWARDED_SCHEME']) == 'https') {
            return 'X-Forwarded-Scheme';
        }

        if (isset($_SERVER['HTTP_X_URL_SCHEME']) && strtolower($_SERVER['HTTP_X_URL_SCHEME']) == 'https') {
            return 'X-Url-Scheme';
        }

        return null;
    }
717228
def socket(self):
    """"""
    return self._socket or self.read_metadata_by_name(self._name, 'socket', self._socket_type)
508169
public Vector getConnectedSocketDetails() {
    Vector details = new Vector(socketList.size());

    for (Enumeration enumeration = socketList.elements();
         enumeration.hasMoreElements();
            ) {
      Socket socket = (Socket) enumeration.nextElement();
      details.add(
        new SocketDetail(socket, (SocketNode13) socketMap.get(socket)));
    }

    return details;
  }
157568
public static ntp_server update(nitro_service client, ntp_server resource) throws Exception
	{
		resource.validate("modify");
		return ((ntp_server[]) resource.update_resource(client))[0];
	}
1082959
@Override
  public InetSocketAddress ipLocal()
  {
    Socket s = getSocket();
    
    if (s != null) {
      return (InetSocketAddress) s.getLocalSocketAddress();
    }
    else {
      return null;
    }
  }