class TCPSocket
Overview
A Transmission Control Protocol (TCP/IP) socket.
NOTE To use TCPSocket
, you must explicitly import it with require "socket"
Usage example:
require "socket"
client = TCPSocket.new("localhost", 1234)
client << "message\n"
response = client.gets
client.close
Defined in:
wrench/socket/tcp_socket.crConstructors
Instance methods inherited from class Socket
connect(ip_address : IPAddress, connect_timeout = nil)
connect
Instance methods inherited from module IO::Evented
client_read_timeout : Time::Span | Nil
client_read_timeout,
client_read_timeout=(timeout : Time::Span | Nil) : Time::Span | Nilclient_read_timeout=(read_timeout : Number) : Time::Span | Nil client_read_timeout=, client_write_timeout : Time::Span | Nil client_write_timeout, client_write_timeout=(timeout : Time::Span | Nil) : Time::Span | Nil
client_write_timeout=(write_timeout : Number) : Time::Span | Nil client_write_timeout=