METADAPT-B supports setting a message length limit

This commit is contained in:
2025-04-04 16:07:20 -04:00
parent 174634a330
commit 1ac0ed51c7
3 changed files with 45 additions and 10 deletions

View File

@@ -3,6 +3,8 @@ package hopp
import "net"
// import "time"
const defaultSizeLimit = 1024 * 1024 // 1 megabyte
// Conn is a HOPP connection.
type Conn interface {
// Close closes the connection. Any blocked operations on the connection
@@ -19,6 +21,10 @@ type Conn interface {
// AcceptTrans accepts a transaction from the other party. This must
// be called in a loop to avoid the connection locking up.
AcceptTrans() (Trans, error)
// SetSizeLimit sets a limit (in bytes) for how large messages can be.
// By default, this limit is 1 megabyte.
SetSizeLimit(limit int)
}
// Trans is a HOPP transaction.