[nanomsg] Re: macat (mangos nanocat drop-in)

  • From: Ondrej Kupka <ondra.cap@xxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Tue, 22 Apr 2014 22:40:59 +0200

Hi,

On Apr 22, 2014, at 10:35 AM, Garrett D'Amore wrote:

> I’ve implemented “macat” (I did say I suck at names right?) which is a drop 
> in replacement for nanocat.  Its really handy for testing, since you can have 
> nanocat on one side, and macat on the other.  (There are some things I don’t 
> like about nanocat and would like to change, but I thought interop to be more 
> useful for now.  Specifically, for some patterns, having a maximum receive 
> count would be a nice feature — e.g. receive only “n” packets, most often 
> going to be just “1” for a one-shot.
> 
> https://bitbucket.org/gdamore/mangos/src/e70c9eb062957c9908305b95cba12e5d9056ca50/macat/macat.go?at=master
> 
> This utility does require another 3rd party library for option parsing.  
> (Go’s “flag” package is … lame.  Specifically, I need the ability to have 
> repeat options, e.g. multiple instances of “-v” or “—bind” to bind to 
> multiple addresses at once.)
> 

You can do that using "flag". See Value interface. You can simply wrap a list 
or something in this and implement the Set method that would append to an 
internal list or so…

Regards,
Ondrej

> Anyway, enjoy!
> 
> -- 
> Garrett D'Amore
> Sent with Airmail

Other related posts: