hopp/connection.go
sashakoshka@tebibyte.media 92b3da4282 Connections do not accept transactions using a context
Having there be a mandatory context will just create more waste
and slow stuff down for transports which don't support it.
2025-01-19 19:18:35 -05:00

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)
}