Sha256: c61a23be3c25fb23606cb04736c2f97155ae54732b628c20dac5b3fe003b4667

Contents?: true

Size: 1.18 KB

Versions: 22

Compression:

Stored size: 1.18 KB

Contents

# TCPSocket represents a TCP/IP client socket.
#
# A simple client may look like:
#
#     require 'socket'
#
#     s = TCPSocket.new 'localhost', 2000
#
#     while line = s.gets # Read lines from socket
#       puts line         # and print them
#     end
#
#     s.close             # close socket when done
class TCPSocket < IPSocket
  # Use Addrinfo.getaddrinfo instead. This method is deprecated for the following
  # reasons:
  #
  # *   The 3rd element of the result is the address family of the first address.
  #     The address families of the rest of the addresses are not returned.
  # *   gethostbyname() may take a long time and it may block other threads. (GVL
  #     cannot be released since gethostbyname() is not thread safe.)
  # *   This method uses gethostbyname() function already removed from POSIX.
  #
  #
  # This method lookups host information by *hostname*.
  #
  #     TCPSocket.gethostbyname("localhost")
  #     #=> ["localhost", ["hal"], 2, "127.0.0.1"]
  #
  def self.gethostbyname: (String host) -> [String, Array[String], Integer, String]

  private

  def initialize: (String remote_host, Integer remote_port, ?String local_host, ?Integer local_port) -> untyped
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
rbs-2.0.0 stdlib/socket/0/tcp_socket.rbs
rbs-2.0.0.pre2 stdlib/socket/0/tcp_socket.rbs
rbs-2.0.0.pre1 stdlib/socket/0/tcp_socket.rbs
rbs-1.8.1 stdlib/socket/0/tcp_socket.rbs
rbs-1.8.0 stdlib/socket/0/tcp_socket.rbs
rbs-1.7.1 stdlib/socket/0/tcp_socket.rbs
rbs-1.7.0 stdlib/socket/0/tcp_socket.rbs
rbs-1.7.0.beta.5 stdlib/socket/0/tcp_socket.rbs
rbs-1.7.0.beta.4 stdlib/socket/0/tcp_socket.rbs
rbs-1.7.0.beta.3 stdlib/socket/0/tcp_socket.rbs
rbs-1.7.0.beta.2 stdlib/socket/0/tcp_socket.rbs
rbs-1.7.0.beta.1 stdlib/socket/0/tcp_socket.rbs
rbs-1.6.2 stdlib/socket/0/tcp_socket.rbs
rbs-1.6.1 stdlib/socket/0/tcp_socket.rbs
rbs-1.6.0 stdlib/socket/0/tcp_socket.rbs
rbs-1.5.1 stdlib/socket/0/tcp_socket.rbs
rbs-1.5.0 stdlib/socket/0/tcp_socket.rbs
rbs-1.4.0 stdlib/socket/0/tcp_socket.rbs
rbs-1.3.3 stdlib/socket/0/tcp_socket.rbs
rbs-1.3.2 stdlib/socket/0/tcp_socket.rbs