Class: Kgio::UNIXSocket

Inherits:
UNIXSocket
  • Object
show all
Includes:
SocketMethods
Defined in:
ext/kgio/connect.c,
ext/kgio/connect.c

Overview

Kgio::UNIXSocket should be used in place of the plain UNIXSocket when kgio_* methods are needed.

Class Method Summary collapse

Class Method Details

.new(path) ⇒ Object

Kgio::UNIXSocket.new(“/path/to/unix/socket”) -> socket

Creates a new Kgio::UNIXSocket object and initiates a non-blocking connection.

This may block and call any method defined to kgio_wait_writable for the class.



273
274
275
276
# File 'ext/kgio/connect.c', line 273

static VALUE kgio_unix_connect(VALUE klass, VALUE path)
{
	return unix_connect(klass, path, 1);
}

.start(path) ⇒ Object

Kgio::UNIXSocket.start(“/path/to/unix/socket”) -> socket

Creates a new Kgio::UNIXSocket 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.



289
290
291
292
# File 'ext/kgio/connect.c', line 289

static VALUE kgio_unix_start(VALUE klass, VALUE path)
{
	return unix_connect(klass, path, 0);
}