blob: 2fa531e6a1edff80d311266b3150845a1a537b41 (
plain)
1
2
3
4
5
6
7
8
9
10
|
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))
except Exception as inst:
main_log.error('Network down. All network based renderers and sensors will not function.',
inst)
return sock
|