[nanomsg] Re: more updates

  • From: jimmy frasche <soapboxcicero@xxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Mon, 21 Apr 2014 20:00:15 -0700

If you're not aware TestBusTLS fails and when tested with -race,
TestBusIPC and TestBusTCP fail as well, though not always and without
detecting any races.

From a cursory look:

Use golint: https://github.com/golang/lint

—

RemEndpoint should be RemoveEndpoint.

Is there any reason all the sps are in one package? It looks like
you've built a generic framework for them to implement. It would be
more idiomatic if you had something like

import "bitbucket.org/gdamore/mangos/req"

...

r, err := req.Dial(...)

instead of

import "bitbucket.org/gdamore/mangos"

...

r, err := mangos.NewSocket(...)

A mangos.Dial could still work if the protocols register with mangos on init.

Additionally this would mean you could have a websocket transport
without requiring every one importing the package having to link to a
websocket package

—

Why have ProtocolFactory be an interface instead of

type ProtocolFactory func() Protocol

Is there every any reason for a protocol factory to have any state
between calls? It doesn't seem like it should ever.

—

The uint16 for protocol numbers could be a type with a String() method.

—

You may want to consider implementing io.Reader/Writer for sockets.
The gorilla websocket package has a nice example for using it over a
message oriented protocol:
http://godoc.org/github.com/gorilla/websocket#Conn.NextReader

This allows a great deal of interop.

Other related posts: