Nazdar!
Zacal som riesit kniznicu socket a mam maly problem.
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1)
while True:
try:
s.connect(("servername", 50007))
break
except socket.timeout:
print "timeout"
Pri tomto kode dostanem takyto vystup:
timeout
Traceback (most recent call last):
File "test.py", line 8, in <module>
s.connect(("192.168.0.120", 50007))
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 114] Operation already in progress
Teda timeout bol, ale ked sa pripajal druhy krat nastala tato chyba. Chcem aby sa pripajal dovtedy kym sa mu to nepodari (kym sa server nevytvori). Neviete ako to riesit?