about summary refs log tree commit homepage
path: root/lib/kgio.rb
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2010-09-29 18:25:58 -0700
committerEric Wong <e@yhbt.net>2010-09-29 18:31:27 -0700
commit2a6115a89d5c95428bd6c3e0bc10e5a3a4c3c3be (patch)
tree77851c1db59ebf828dd1f88b231b1b4f0b1734db /lib/kgio.rb
parent8fe89997453d6c530c3f5e08bc9c1da40a621248 (diff)
downloadkgio-2a6115a89d5c95428bd6c3e0bc10e5a3a4c3c3be.tar.gz
Making the code easier to read and navigate.  This also
frees us from having to use the stupid A4_ prefix for
accept4(2) flags since it conflicts with the socket(2)
ones.
Diffstat (limited to 'lib/kgio.rb')
-rw-r--r--lib/kgio.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/kgio.rb b/lib/kgio.rb
index e104f46..ae7eac8 100644
--- a/lib/kgio.rb
+++ b/lib/kgio.rb
@@ -1,3 +1,21 @@
+# -*- encoding: binary -*-
+require 'socket'
+module Kgio
+
+  # The IPv4 address of UNIX domain sockets, useful for creating
+  # Rack (and CGI) servers that also serve HTTP traffic over
+  # UNIX domain sockets.
+  LOCALHOST = '127.0.0.1'
+end
+
+# Kgio::PipeMethods#kgio_tryread and Kgio::SocketMethods#kgio_tryread will
+# return this constant when waiting for a read is required.
+module Kgio::WaitReadable; end
+
+# PipeMethods#kgio_trywrite and SocketMethods#kgio_trywrite will
+# return this constant when waiting for a read is required.
+module Kgio::WaitWritable; end
+
 require 'kgio_ext'
 
 # use Kgio::Pipe.popen and Kgio::Pipe.new instead of IO.popen