mirror of
https://github.com/codecat/go-enet.git
synced 2025-12-08 05:59:47 +00:00
handle -1 to be specific and != 0 for catch all just in case
This commit is contained in:
parent
597244d7f6
commit
1058882792
1 changed files with 3 additions and 1 deletions
4
host.go
4
host.go
|
|
@ -54,8 +54,10 @@ func (host *enetHost) Connect(addr Address, channelCount int, data uint32) (Peer
|
|||
func (host *enetHost) CompressWithRangeCoder() error {
|
||||
status := C.enet_host_compress_with_range_coder(host.cHost)
|
||||
|
||||
if status != 0 {
|
||||
if status == -1 {
|
||||
return errors.New("couldn't set the packet compressor to default range coder because context is nil")
|
||||
} else if status != 0 {
|
||||
return errors.New("couldn't set the packet compressor to default range coder for unknown reason")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue