Skip to content

Commit

Permalink
Added error message
Browse files Browse the repository at this point in the history
  • Loading branch information
famez committed Sep 8, 2019
1 parent a44681b commit 62c8011
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package session

import (
"net"
"os"
"strconv"

"github.com/famez/Radius-Spy/radius"
Expand Down Expand Up @@ -89,15 +90,15 @@ func setupUDPServer(port int) *net.UDPConn {
localAddr, err := net.ResolveUDPAddr(protocol, addrToListen)

if err != nil {
glog.V(3).Infoln("Wrong Address")
return nil
glog.V(0).Infoln("Could not bind to the corresponding port:", port)
os.Exit(-1)
}

clientConn, err := net.ListenUDP(protocol, localAddr)

if err != nil {
glog.V(3).Infoln("Error", err)
return nil
glog.V(0).Infoln("Error", err)
os.Exit(-1)
}

return clientConn
Expand Down

0 comments on commit 62c8011

Please sign in to comment.