defnull/pixelflut

pixelnuke: Connection reset by peer

emdete opened this issue · 2 comments

i see this error ("ConnectionResetError: [Errno 104] Connection reset by peer") with a small py script wrote. i extracted the main part here:

#!/usr/bin/env python3    
from socket import socket, AF_INET, SOCK_STREAM, MSG_DONTWAIT    
from random import randint                          
    
sock = socket(AF_INET, SOCK_STREAM)    
sock.connect(("127.0.0.1", 1337))    
while True:    
    x, y = 512, 260                                                              
    r, g, b = randint(0,255), randint(0,255), randint(0,255)    
    for _ in range(10000):    
        sock.send(('PX %d %d %02x%02x%02x\n' % (x,y,r,g,b)).encode())    
        x += randint(0,2)-1    
        y += randint(0,2)-1

it runs fine for a while until it breaks with the error above. no clue who's to blame but it seems pixelnuke closed the connection.

Your x or y coordinate may eventually become negative. Pixelnuke will send an error message (that you do not see because your client does not read from the socket) and close the connection.

wow, well spotted, thank you & sorry ;)