Sha256: 494a0c12d43c6ba13e7fd116a4b19e78947df4d63589934c101d8a22907e44c9

Contents?: true

Size: 1.48 KB

Versions: 64

Compression:

Stored size: 1.48 KB

Contents

# <!-- rdoc-file=ext/socket/tcpsocket.c -->
# 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
  # <!--
  #   rdoc-file=ext/socket/tcpsocket.c
  #   - TCPSocket.gethostbyname(hostname) => [official_hostname, alias_hostnames, address_family, *address_list]
  # -->
  # 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

  # <!--
  #   rdoc-file=lib/resolv-replace.rb
  #   - new(host, serv, *rest)
  # -->
  #
  def initialize: (String remote_host, Integer remote_port, ?String local_host, ?Integer local_port) -> untyped
end

Version data entries

64 entries across 64 versions & 2 rubygems

Version Path
rbs-3.7.0.pre.1 stdlib/socket/0/tcp_socket.rbs
rbs-3.7.0.dev.1 stdlib/socket/0/tcp_socket.rbs
rbs-3.6.1 stdlib/socket/0/tcp_socket.rbs
rbs-3.6.0 stdlib/socket/0/tcp_socket.rbs
rbs-3.6.0.pre.3 stdlib/socket/0/tcp_socket.rbs
rbs-3.6.0.pre.2 stdlib/socket/0/tcp_socket.rbs
rbs-3.6.0.pre.1 stdlib/socket/0/tcp_socket.rbs
rbs-3.6.0.dev.1 stdlib/socket/0/tcp_socket.rbs
rbs-3.5.3 stdlib/socket/0/tcp_socket.rbs
rbs-3.5.2 stdlib/socket/0/tcp_socket.rbs
rbs-3.5.1 stdlib/socket/0/tcp_socket.rbs
rbs-3.5.1.pre.1 stdlib/socket/0/tcp_socket.rbs
rbs-3.5.0 stdlib/socket/0/tcp_socket.rbs
rbs-3.5.0.pre.2 stdlib/socket/0/tcp_socket.rbs
rbs-3.5.0.pre.1 stdlib/socket/0/tcp_socket.rbs
rbs-3.4.4 stdlib/socket/0/tcp_socket.rbs
rbs-3.4.3 stdlib/socket/0/tcp_socket.rbs
rbs-3.4.2 stdlib/socket/0/tcp_socket.rbs
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rbs-2.8.4/stdlib/socket/0/tcp_socket.rbs
rbs-3.4.1 stdlib/socket/0/tcp_socket.rbs