Socket.new(domain, socktype [, protocol]) => socket
Class Public methods
Creates a new socket object.
domain should be a communications domain such as: :INET, :INET6, :UNIX, etc.
socktype should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
protocol is optional and should be a protocol defined in the domain. If protocol is not given, 0 is used internally.
Socket.new(:INET, :STREAM) # TCP socket Socket.new(:INET, :DGRAM) # UDP socket Socket.new(:UNIX, :STREAM) # UNIX stream socket Socket.new(:UNIX, :DGRAM) # UNIX datagram socket
Please login to continue.