Giter Club home page Giter Club logo

tupleserver's Introduction

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.

tupleserver's People

tupleserver's Issues

SO_REUSEADDR should be set before calling bind()

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.