Permalink
Browse files

Fixed issues with overly long return strings using the command manage…

…r interface by lowering the socket buffer size and max packet byte length.
  • Loading branch information...
1 parent 7c5fc36 commit ea865195b625d70e55af7ae79a36521f9a5ff70c Nathan Rusch committed May 4, 2011
Showing with 13 additions and 4 deletions.
  1. +2 −2 nukeCommandClient.py
  2. +11 −2 nukeCommandServer.py
View
@@ -23,7 +23,7 @@
# any flags or arguments).
NUKE_EXEC = 'Nuke'
-MAX_SOCKET_BYTES = 16384
+MAX_SOCKET_BYTES = 2048
class NukeLicenseError(StandardError):
pass
@@ -72,7 +72,7 @@ def find_connection_port(self, start_port, end_port):
return -1
def send(self, data):#
- size = 1024 * 1024
+ size = 4096
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
View
@@ -1,3 +1,9 @@
+'''
+This script defines the server-side classes for the Nuke command server interface.
+
+It can also be passed as an executable to automatically start server instances.
+'''
+
import pickle
import socket
import threading
@@ -8,7 +14,7 @@
listTypes = [list, tuple, set, frozenset]
dictTypes = [dict]
-MAX_SOCKET_BYTES = 16384
+MAX_SOCKET_BYTES = 2048
class NukeConnectionError(StandardError):
pass
@@ -24,7 +30,7 @@ def __init__(self, port=None):
self._next_object_id = 0
self.port = port
self.bound_port = False
- self.buffer_size = 1024 * 1024
+ self.buffer_size = 4096
host = ''
backlog = 5
@@ -233,3 +239,6 @@ def manager_callback(self, status):
manager.close()
if not status:
raise NukeConnectionError("Cannot find port to bind to")
+
+if __name__ == '__main__':
+ NukeInternal()

0 comments on commit ea86519

Please sign in to comment.