blob: b3d81d14884a02b8fdda55f7e9b276d3e09bb972 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()
|