ENOENT while creating a UNIX socket in Ruby -


i'm trying create socket in ruby using

require "socket" w = unixsocket.new("socket") 

and keep running into

no such file or directory - socket (errno::enoent) 

this looks backwards me, because new() supposed create missing file. missing?

this super old. please don't try use verbatim anymore.

http://blog.antarestrader.com/posts/153

#!/ruby file = 'path/to/my/socket' file.unlink if file.exists(file) && file.socket?(file) server = unixserver.new(file) # return unixsocket once connection made  socket = server.accept # socket ready communicate. 

unixserver makes socket, unixsocket connects existing socket.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -