mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Various API changes and simplifications to fix mobile builds
This commit is contained in:
parent
9b99f0b5e4
commit
de1005e4fa
13 changed files with 63 additions and 122 deletions
|
@ -35,8 +35,17 @@ func (e *ConnError) Temporary() bool {
|
|||
// PacketTooBig returns in response to sending a packet that is too large, and
|
||||
// if so, the maximum supported packet size that should be used for the
|
||||
// connection.
|
||||
func (e *ConnError) PacketTooBig() (bool, int) {
|
||||
return e.maxsize > 0, e.maxsize
|
||||
func (e *ConnError) PacketTooBig() bool {
|
||||
return e.maxsize > 0
|
||||
}
|
||||
|
||||
// PacketMaximumSize returns the maximum supported packet size. This will only
|
||||
// return a non-zero value if ConnError.PacketTooBig() returns true.
|
||||
func (e *ConnError) PacketMaximumSize() int {
|
||||
if !e.PacketTooBig() {
|
||||
return 0
|
||||
}
|
||||
return e.maxsize
|
||||
}
|
||||
|
||||
// Closed returns if the session is already closed and is now unusable.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue