func (c *Context) NewSocket(typ int, identity string) (*Socket, error) {
	var r readerPool
	var w *frameWriter
	switch typ {
	case SOCK_PUB:
		mw := newMultiWriter()
		w = newFrameWriter(mw)
	case SOCK_SUB:
		r = newQueuedReader()
	case SOCK_PULL:
		r = newQueuedReader()
	case SOCK_PUSH:
		lbw := newLbWriter()
		w = newFrameWriter(lbw)
	case SOCK_PAIR, SOCK_REQ, SOCK_REP:
		fallthrough
	default:
		return nil, errors.New("socket type unimplemented")
	}
	return &Socket{c, identity, r, w}, nil
}
NewSocket creates a new Socket within the Context c.
Initially the Socket is not associated with any endpoints.
package zmq
import (
	"errors"
	"io"
	"net"
	"strings"
)
const (
	SOCK_PAIR = iota
	SOCK_PUB
	SOCK_SUB
	SOCK_REQ
	SOCK_REP
	SOCK_PULL
	SOCK_PUSH
)
type Socket struct {
	c        *Context
	identity string
	r        readerPool
	w        *frameWriter
}