chef-boneyard / win32-pipe Goto Github PK
View Code? Open in Web Editor NEWA Ruby interface for named pipes on MS Windows
A Ruby interface for named pipes on MS Windows
== Description A Ruby interface for named pipes on Windows. == Prerequisites ffi == Installation gem install win32-pipe == Synopsis require 'win32/pipe' include Win32 # In server.rb pipe_server = Pipe::Server.new("foo_pipe") pipe_server.connect data = pipe_server.read puts "Got #{data} from client" pipe_server.close # In client.rb (run from a different shell) pipe_client = Pipe::Client.new("foo_pipe") pipe_client.write("Hello World") pipe_client.close == What's a named pipe? A pipe with a name - literally. In practice, it will feel more like a cross between a socket and a pipe. At least, it does to me. == What good is it? My hope is that it can be used in certain circumstances where a fork might be desirable, but which is not possible on Windows. It could also be handy for the traditional "piping data to a server" usage. And if you come up with anything cool, please let us all know! == Contributions Although this library is free, please consider having your company setup a gittip if used by your company professionally. http://www.gittip.com/djberg96/ == Future Plans Add transactions == License Artistic 2.0 == Warranty This package is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose. == Copyright (C) 2003-2014, Daniel J. Berger, All Rights Reserved. == Authors Daniel Berger Park Heesob
Hi--
I tried to run the server.rb/client.rb Hello World, but I got this.
In one terminal:
c:>ruby server.rb
Got Hello World from client
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/win32-pipe-0.3.7/lib/win32/pipe/client.rb:52:in initialize': No such file or directory - CreateFile (Errno::ENOENT) from server.rb:27:in
new'
from server.rb:27:in `
In another:
c:>ruby client.rb
I have both win32-api and win32-pipe installed on a fresh install of Ruby2.2.
Thanks!
--Myles
I use vmware generate a named pipe (\.\pipe\com_1)
code like this
Pipe::Client.new('\\\\.\\pipe\\com_1') do |pipe|
data = pipe.read
puts "get it #{data}"
end
received error:
in `initialize': No such file or directory - CreateFile (Errno::ENOENT)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.