blob: 6c50c6dcc9ca8cfe221c9c4ba586497f936d2598 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
import socket
from logger import main_log, exception_log
def getConnectedSocket(ip,port):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
sock.connect((ip, port))
return sock
except Exception as inst:
main_log.error('Network down. All network based renderers and sensors will not function.',
inst)
print (ip, port)
|