Module: Kgio::SocketMethods

Includes:
DefaultWaiters
Defined in:
ext/kgio/autopush.c,
ext/kgio/kgio_ext.c

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DefaultWaiters

#kgio_wait_readable, #kgio_wait_writable

Instance Attribute Details

#kgio_addrObject

Returns the client IP address of the socket as a string (e.g. “127.0.0.1” or “::1”). This is always the value of the Kgio::LOCALHOST constant for UNIX domain sockets.

Instance Method Details

#kgio_autopush=(vbool) ⇒ Object

io.kgio_autopush = true io.kgio_autopush = false

Enables or disables autopush on any given Kgio::SocketMethods-capable IO object. This does NOT enable or disable TCP_NOPUSH/TCP_CORK right away, that must be done with IO.setsockopt

Only available on systems with TCP_CORK (Linux) or TCP_NOPUSH (FreeBSD, and maybe other *BSDs).



149
150
151
152
153
154
155
156
# File 'ext/kgio/autopush.c', line 149

static VALUE autopush_set(VALUE io, VALUE vbool)
{
	if (RTEST(vbool))
		state_set(io, AUTOPUSH_STATE_WRITER);
	else
		state_set(io, AUTOPUSH_STATE_IGNORE);
	return vbool;
}

#kgio_autopush?Boolean

io.kgio_autopush? -> true or false

Returns the current autopush state of the Kgio::SocketMethods-enabled socket.

Only available on systems with TCP_CORK (Linux) or TCP_NOPUSH (FreeBSD, and maybe other *BSDs).

Returns:

  • (Boolean)


131
132
133
134
# File 'ext/kgio/autopush.c', line 131

static VALUE autopush_get(VALUE io)
{
	return state_get(io) <= 0 ? Qfalse : Qtrue;
}