mirror of
https://github.com/number571/go-peer.git
synced 2026-09-14 02:55:43 +05:00
27 lines
815 B
Go
27 lines
815 B
Go
package network
|
|
|
|
const (
|
|
errPrefix = "pkg/network = "
|
|
)
|
|
|
|
type SNetworkError struct {
|
|
str string
|
|
}
|
|
|
|
func (err *SNetworkError) Error() string {
|
|
return errPrefix + err.str
|
|
}
|
|
|
|
var (
|
|
ErrNoConnections = &SNetworkError{"no connections"}
|
|
ErrWriteTimeout = &SNetworkError{"write timeout"}
|
|
ErrBroadcastMessage = &SNetworkError{"broadcast message"}
|
|
ErrCreateListener = &SNetworkError{"create listener"}
|
|
ErrListenerAccept = &SNetworkError{"listener accept"}
|
|
ErrHasLimitConnections = &SNetworkError{"has limit connections"}
|
|
ErrConnectionIsExist = &SNetworkError{"connection already exist"}
|
|
ErrConnectionIsNotExist = &SNetworkError{"connection is not exist"}
|
|
ErrCloseConnection = &SNetworkError{"close connection"}
|
|
ErrAddConnections = &SNetworkError{"add connection"}
|
|
)
|