The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Frames is a simple multiplexing protocol I use when I need to ask for
a lot of different things concurrently between two servers and I don't
want to burn lots of file descriptors or rely on pipelining timings
and such things to do it.
This should be usable anywhere you use a =net.Conn= today. There's
some convenience support for HTTP as I'm using it quite a bit as an
HTTP transport.
* Protocol
The protocol is really simple, just a 6 byte header followed by 0 or
more bytes of data (maximum data size of 2^16).
|-------------+---------------------+-------------+----------|
| Field | Type | Byte Offset | Byte Len |
|-------------+---------------------+-------------+----------|
| Data Length | unsigned 16-bit int | 0 | 2 |
| Channel | unsigned 16-bit int | 2 | 2 |
| Command | byte | 4 | 1 |
| Status | byte | 5 | 1 |
** Definitions
*** Commands
|---------+------|
| Command | ID |
|---------+------|
| Open | 0x00 |
| Close | 0x01 |
| Data | 0x02 |
*** Status
|---------+----|
| Status | ID |
|---------+----|
| Success | 0 |
| Error | 1 |
** Flow
A client begins by establishing a TCP connection. To do anything
useful, it must first issue an =Open= command to get a new channel
assigned. If this is successful (=Status= = =Success=), the client
will get a response with the Command set to =Open= and the channel
ID set to the new channel.
A client may open as many channels as necessary and then send =Data=
packets along with the corresponding data.
A client MUST =Close= the channel when you're done with it if you
intend to continue using the service. If the client is completely
done, it MAY drop the underlying TCP connection and the server MUST
clean up after you.
const (
// FrameOpen is a command to open a channel on a connection. FrameOpen = FrameCmd(iota)
// FrameClose is a command to close a channel on a connection. FrameClose
// FrameData is a command indicating the packet contains data. FrameData
)
const (
// FrameSuccess is the status indicating a successful command. FrameSuccess = FrameStatus(iota)
// FrameError is the status indicating a failed command. FrameError
)
ListenerListener is a listener that listens on a net.Listener and
returns framed connections opened from connections opened by the
underlying Listener.
type FramePacket struct {
// The command Cmd FrameCmd// Status int Status FrameStatus// Channel over which the command should be sent. Channel uint16// Extra data for the command. Data []byte// contains filtered or unexported fields
}
A FramePacket is a packet sent or received over a connection.