Skip to content
instance method

BasicSocket#send

(::String msg, ?::Integer flags, ?::Addrinfo | ::String dest_sockaddr) -> void
basicsocket.send(mesg, flags [, dest_sockaddr]) => numbytes_sent

send mesg via basicsocket.

mesg should be a string.

flags should be a bitwise OR of Socket::MSG_* constants.

dest_sockaddr should be a packed sockaddr string or an addrinfo.

Example
TCPSocket.open("localhost", 80) {|s|
  s.send "GET / HTTP/1.0\r\n\r\n", 0
  p s.read
}