Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1269

Python • Re: fails to read localhost over TCP from python, but comd netcat works

$
0
0
You need to bind the socket to an ip/port.

Code:

STREAM_IP = ""STREAM_PORT = 5005sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)try:   sock.bind((STREAM_IP, STREAM_PORT))except:   print("bind failed")   sys.exit(1)

Statistics: Posted by SurferTim — Tue Oct 08, 2024 9:46 am



Viewing all articles
Browse latest Browse all 1269

Trending Articles