HACKING ISSUES LICENSE NEWS README
Kgio DefaultWaiters File Pipe PipeMethods Socket SocketMethods TCPServer TCPSocket UNIXServer UNIXSocket

Methods

#kgio_accept #kgio_tryaccept

class Kgio::TCPServer

Kgio::TCPServer should be used in place of the plain TCPServer when kgio_accept and kgio_tryaccept methods are needed.

Public Instance Methods

server = Kgio::TCPServer.new('0.0.0.0', 80)
server.kgio_accept -> Kgio::Socket or nil
server.kgio_tryaccept -> Kgio::Socket or nil
server.kgio_tryaccept(klass = MySocket) -> MySocket or nil source

Initiates a blocking accept and returns a generic Kgio::Socket object with the kgio_addr attribute set to the IP address of the client on success.

On Ruby implementations using native threads, this can use a blocking accept(2) (or accept4(2)) system call to avoid thundering herds.

An optional klass argument may be specified to override the Kgio::Socket-class on a successful return value.

An optional flags argument may also be specified. flags is a bitmask that may contain any combination of:

server = Kgio::TCPServer.new('0.0.0.0', 80)
server.kgio_tryaccept -> Kgio::Socket or nil
server.kgio_tryaccept(klass = MySocket) -> MySocket or nil
server.kgio_tryaccept(nil, flags) -> Kgio::Socket or nil source

Initiates a non-blocking accept and returns a generic Kgio::Socket object with the kgio_addr attribute set to the IP address of the connected client on success.

Returns nil on EAGAIN, and raises on other errors.

An optional klass argument may be specified to override the Kgio::Socket-class on a successful return value.

An optional flags argument may also be specified. flags is a bitmask that may contain any combination of:

Parent: cTCPServer
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