From 45ac0d237a3e69949c66285f7ddabd1d39138474 Mon Sep 17 00:00:00 2001 From: anthdm Date: Thu, 1 Feb 2018 08:19:12 +0100 Subject: [PATCH] changed string port args to int --- pkg/network/tcp.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/network/tcp.go b/pkg/network/tcp.go index e8421265e..a1280a6b0 100644 --- a/pkg/network/tcp.go +++ b/pkg/network/tcp.go @@ -2,14 +2,15 @@ package network import ( "bytes" + "fmt" "net" "github.com/anthdm/neo-go/pkg/network/payload" "github.com/anthdm/neo-go/pkg/util" ) -func listenTCP(s *Server, port string) error { - ln, err := net.Listen("tcp", port) +func listenTCP(s *Server, port int) error { + ln, err := net.Listen("tcp", fmt.Sprintf(":%d", port)) if err != nil { 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) { command := msg.commandType()