diff options
author | Zachary Turner <zturner@google.com> | 2015-11-24 21:35:32 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-11-24 21:35:32 +0000 |
commit | 0a2899ca82318b775dfba5bdbb42102393dc6f6e (patch) | |
tree | 47ded85196f44691a6fa2f919b5a8393d2e5c4c6 /lldb/packages/Python/lldbsuite/support | |
parent | 2db36097b4b0df68aec40feefaff7a534edf0f0c (diff) | |
download | bcm5719-llvm-0a2899ca82318b775dfba5bdbb42102393dc6f6e.tar.gz bcm5719-llvm-0a2899ca82318b775dfba5bdbb42102393dc6f6e.zip |
swig_bot remote path connection / preliminary implementation.
With this patch, the client will package up all the required
inputs into a compressed zip file, establish a connection to the
server, send the input to the server, and wait for the server to
send a response (in this case the response is just echoed back to
the client).
This gets the network communication in place, and in a subsequent
patch I will follow up with the code that actually runs swig on
the server and sends back the output instead of echoing back the
input.
llvm-svn: 254023
Diffstat (limited to 'lldb/packages/Python/lldbsuite/support')
-rw-r--r-- | lldb/packages/Python/lldbsuite/support/sockutil.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/support/sockutil.py b/lldb/packages/Python/lldbsuite/support/sockutil.py new file mode 100644 index 00000000000..b3d81d14884 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/support/sockutil.py @@ -0,0 +1,23 @@ +""" + The LLVM Compiler Infrastructure + +This file is distributed under the University of Illinois Open Source +License. See LICENSE.TXT for details. + +Helper functions for working with sockets. +""" + +# Python modules: +import io +import socket + +# LLDB modules +import use_lldb_suite + +def recvall(sock, size): + bytes = io.BytesIO() + while size > 0: + this_result = sock.recv(size) + bytes.write(this_result) + size -= len(this_result) + return bytes.getvalue() |