A generic socket class with Kgio::SocketMethods
included. This is returned by all Kgio
methods that accept(2) a connected stream socket.
addr = Socket.pack_sockaddr_in(80, 'example.com') Kgio::Socket.connect(addr) -> socket addr = Socket.pack_sockaddr_un("/path/to/unix/socket") Kgio::Socket.connect(addr) -> socket source
Creates a generic Kgio::Socket
object and initiates a non-blocking connection.
This may block and call any method defined to kgio_wait_writable
for the class.
new (*args) source
If passed one argument, this is identical to Kgio::Socket.connect
. If passed two or three arguments, it uses its superclass method:
Socket.new(domain, socktype [, protocol ])
addr = Socket.pack_sockaddr_in(80, 'example.com') Kgio::Socket.start(addr) -> socket addr = Socket.pack_sockaddr_un("/path/to/unix/socket") Kgio::Socket.start(addr) -> socket source
Creates a generic Kgio::Socket
object and initiates a non-blocking connection. The caller should select/poll on the socket for writability before attempting to write or optimistically attempt a write and handle :wait_writable or Errno::EAGAIN.
s = Kgio::Socket.new(:INET, :STREAM) addr = Socket.pack_sockaddr_in(80, "example.com") s.kgio_fastopen("hello world", addr) -> nil source
Starts a TCP connection using TCP Fast Open. This uses a blocking sendto() syscall and is only available on Ruby 1.9 or later. This raises exceptions (including Errno::EINPROGRESS/Errno::EAGAIN) on errors. Using this is only recommended for blocking sockets.
Timeouts may be set with setsockopt:
s.setsockopt(:SOCKET, :SNDTIMEO, [1,0].pack("l_l_"))
Parent: cSocket
Included modules: mSocketMethods
Pages
Classes
Methods
mail archives: https://yhbt.net/kgio-public/ http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/kgio-public/ nntp://news.public-inbox.org/inbox.comp.lang.ruby.kgio nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.lang.ruby.kgio public: kgio-public@yhbt.net source code: git clone https://yhbt.net/kgio.git torsocks git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/kgio.git