def send_encoded(conn, obj):
msg_bytes = cPickle.dumps(obj, cPickle.HIGHEST_PROTOCOL)
data = struct.pack("!I", len(msg_bytes)) + msg_bytes
with wrapped_socket_errnos(errno.ECONNRESET, errno.EPIPE):
conn.sendall(data)
评论列表
文章目录