Hi. This IP-number is on the server you’re trying to run the script on? Or maybe the second time you run the program is the port not yet released? Close the connections returned by Accept()
And because the for loop never exits will waitForExitSignal() never be called. But this is not your problem. Try to connect to all interfaces on the server if you can with net.Listen(“tcp”, “:49156”)
the programs works fine, but I don’t get any messages from server. If I call with net.List(“tcp”,":49156") I get listen from all port 49159 of my network?
That net.Dial succeeds does only mean, that some device with that IP is visible to your network, it does not mean that this address is bound to any interface on your computer.
Edit
I’m not sure what you mean by “People Counter Device”. Are you running your program on that device?
The people counter is a device that count the persons that pass through a zone, and when it detects a new passage, the device sends tcp message to port.
My program is running in my computer and what I need is listen the events on port of device.
I’m new to Go programming (about two weeks), but have some experience with socket programming using other languages. And I agree with NobbZ, It seems like you’re trying to bind to an IP address that’s not assigned to the device.