nathanfolkman / tupleserver Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/tupleserver
Automatically exported from code.google.com/p/tupleserver
Tupleserver is a simple line-based protocol. You need Tcl and libevent to compile tupleserver. To compile, simply type "make". Command line arguments: -v <1|0> Run in verbose mode. Default: 0. -d <1|0> Run as a damon. Default: 0. -p <port> Run on the specified port. Default: 5555. Commands: write <tuple> Writes data to the queue. Example: "write test foo bar". read <pattern> Get items from the queue matching the pattern. Example: "read test *" count Returns current queue depth. dump Returns all items currently en-queued, without removing from the queue. exit Exit. Pattern uses Tcl_StringMatch syntax. Tuples are returned FIFO.
The source code for tuple.c from your libevent-based echo server ranks highly
for the Google search "libevent socket server." I came across this source code
while learning how to use libevent.
There is one issue I found with your otherwise very helpful code: the
SO_REUSEADDR option needs to be enabled *before* calling bind(), otherwise the
call to bind() will fail with EADDRINUSE if the server is restarted shortly
after exiting.
To fix this, the setsockopt() call should be moved just before
memset(&listen_addr, ...) and just after the socket() call's return value check.
Original issue reported on code.google.com by [email protected]
on 20 Dec 2010 at 9:58
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.