Having there be a mandatory context will just create more waste and slow stuff down for transports which don't support it.
22 lines
382 B
Go
22 lines
382 B
Go
package hopp
|
|
|
|
import "io"
|
|
|
|
// Conn is a HOPP connection.
|
|
type Conn interface {
|
|
io.Closer
|
|
OpenTrans() (Trans, error)
|
|
AcceptTrans() (Trans, error)
|
|
}
|
|
|
|
// Trans is a HOPP transaction.
|
|
type Trans interface {
|
|
io.Closer
|
|
ID() int64
|
|
|
|
// Send sends a message.
|
|
Send(method uint16, data []byte) error
|
|
// Receive receives a message.
|
|
Receive() (method uint16, data []byte, err error)
|
|
}
|