Socket stream

Christian Maus maus at netz.klinik.uni-mainz.de
Tue Feb 26 09:10:25 EST 2002


Hello,

I try to control a device via a com server. Setting a command to the device 
works fine, but when I try to read the answer, my loop for reading from the 
socket does not terminate. My loop looks like this:

while 1:
       data = sockobj.recv(1024)
       if not data: break
       print data
sockobj.close()

I get the output:

OV
01,00OV02,00OV0
3,00OV04,00OV0
5,00OV06,01OV07
,00OV08,00OV09
,00OV10,00
OV11,00OV12,00
O
V13,00OV14,00
OV15,00
OA01,00
OA02,00OA03,00
OA04,00OA05,00
OA06,00OA07,00
OA08,00OA09,00OA10,00
OA
11,00OA12,00
O
A13,00OA14,
00OA15,00

and then I'm stuck in the loop. Any idea what the problem is?

Thanks in advance

Christian



More information about the Python-list mailing list