hopp/connection.go

22 lines
382 B
Go
Raw Normal View History

2025-01-09 00:31:15 -07:00
package hopp
import "io"
// Conn is a HOPP connection.
type Conn interface {
io.Closer
OpenTrans() (Trans, error)
AcceptTrans() (Trans, error)
2025-01-09 00:31:15 -07:00
}
// 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)
2025-01-09 00:31:15 -07:00
}