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.cr

Constructors

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 | Nil
client_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=

Class methods inherited from class IO

super_copy(src : IO, dst : IO, &) : Int64 super_copy

Constructor Detail

def self.new(ip_address : IPAddress, dns_timeout = nil, connect_timeout = nil) #

[View source]