Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4334 from ynput/bugfix/harmony_mac_unable_change_…
Browse files Browse the repository at this point in the history
…workfile

Harmony: fix unable to change workfile on Mac
  • Loading branch information
kalisp authored Jan 18, 2023
2 parents 0563f84 + f686f74 commit a014a07
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion openpype/hosts/harmony/api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(self, port):

# Create a TCP/IP socket
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

# Bind the socket to the port
server_address = ("127.0.0.1", port)
Expand Down Expand Up @@ -91,7 +92,13 @@ def receive(self):
self.log.info("wait ttt")
# Receive the data in small chunks and retransmit it
request = None
header = self.connection.recv(10)
try:
header = self.connection.recv(10)
except OSError:
# could happen on MacOS
self.log.info("")
break

if len(header) == 0:
# null data received, socket is closing.
self.log.info(f"[{self.timestamp()}] Connection closing.")
Expand Down

0 comments on commit a014a07

Please sign in to comment.