Initial commit

This commit is contained in:
2025-01-09 02:31:15 -05:00
commit 1bc804190e
18 changed files with 2104 additions and 0 deletions

21
connection.go Normal file
View File

@@ -0,0 +1,21 @@
package hopp
import "io"
import "context"
// Conn is a HOPP connection.
type Conn interface {
io.Closer
OpenTrans(ctx context.Context) (Trans, error)
AcceptTrans(ctx context.Context) (Trans, error)
}
// Trans is a HOPP transaction.
type Trans interface {
io.Closer
ID() int64
Send(ctx context.Context, method uint16, data []byte) error
Receive(ctx context.Context) (method uint16, data []byte, err error)
SendDatagram(ctx context.Context, method uint16, data []byte) error
ReceiveDatagram(ctx context.Context) (method uint16, data []byte, err error)
}