INNER CODE UNIT · Python
WrapAndSendPayload
unrealcv/unrealcv · client/python/unrealcv/__init__.py:114
def WrapAndSendPayload(cls, sock, payload):
"""
Send payload, true if success, false if failed
"""
try:
socket_message = SocketMessage(payload)
message = (
struct.pack(cls.fmt, socket_message.magic)
+ struct.pack(cls.fmt, socket_message.payload_size)
+ payload
)
sock.sendall(message)
return True
except Exception as e:
print(f'Fail to send message {e}')
_L.error('Fail to send message %s', e)
return False