changed string port args to int
This commit is contained in:
parent
572bd813cd
commit
45ac0d237a
1 changed files with 4 additions and 2 deletions
|
@ -2,14 +2,15 @@ package network
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/anthdm/neo-go/pkg/network/payload"
|
"github.com/anthdm/neo-go/pkg/network/payload"
|
||||||
"github.com/anthdm/neo-go/pkg/util"
|
"github.com/anthdm/neo-go/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func listenTCP(s *Server, port string) error {
|
func listenTCP(s *Server, port int) error {
|
||||||
ln, err := net.Listen("tcp", port)
|
ln, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -74,6 +75,7 @@ func handleConnection(s *Server, conn net.Conn) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// handleMessage hands the message received from a TCP connection over to the server.
|
||||||
func handleMessage(msg *Message, s *Server, p *TCPPeer) {
|
func handleMessage(msg *Message, s *Server, p *TCPPeer) {
|
||||||
command := msg.commandType()
|
command := msg.commandType()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue