Skip to content

Commit

Permalink
listenAddress can not be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
andeya committed Mar 8, 2018
1 parent b53f31e commit e06533c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ var ErrListenClosed = errors.New("listener is closed")

// Listen turns on the listening service.
func (p *peer) Listen(protoFunc ...socket.ProtoFunc) error {
if len(p.listenAddr) == 0 {
Fatalf("listenAddress can not be empty")
}
lis, err := NewInheritListener(p.network, p.listenAddr, p.tlsConfig)
if err != nil {
Fatalf("%v", err)
Expand Down

0 comments on commit e06533c

Please sign in to comment.