//UtpCreateSocket creates socket func (ctx *UtpContext) UtpCreateSocket() *UtpSocket { s := C.utp_create_socket(ctx.ctx) sock := &UtpSocket{s: s} ctx.sockets[s] = sock sock.ctx = ctx return sock }
func NewUTPSocket(c *UTPContext) *UTPSocket { return &UTPSocket{ ctx: c, raw: C.utp_create_socket(c.raw), lock: sync.Mutex{}, } }