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