aboutsummaryrefslogtreecommitdiffstats
path: root/examples/tcp_message.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tcp_message.py')
-rw-r--r--examples/tcp_message.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/examples/tcp_message.py b/examples/tcp_message.py
index 78500c19..6eced0dc 100644
--- a/examples/tcp_message.py
+++ b/examples/tcp_message.py
@@ -17,9 +17,11 @@ def tcp_message(ctx, tcp_msg):
is_modified = False if modified_msg == tcp_msg.message else True
tcp_msg.message = modified_msg
- print("[tcp_message{}] from {} {} to {} {}:\r\n{}".format(
- " (modified)" if is_modified else "",
- "client" if tcp_msg.sender == tcp_msg.client_conn else "server",
- tcp_msg.sender.address,
- "server" if tcp_msg.receiver == tcp_msg.server_conn else "client",
- tcp_msg.receiver.address, strutils.clean_bin(tcp_msg.message)))
+ print(
+ "[tcp_message{}] from {} {} to {} {}:\r\n{}".format(
+ " (modified)" if is_modified else "",
+ "client" if tcp_msg.sender == tcp_msg.client_conn else "server",
+ tcp_msg.sender.address,
+ "server" if tcp_msg.receiver == tcp_msg.server_conn else "client",
+ tcp_msg.receiver.address, strutils.bytes_to_escaped_str(tcp_msg.message))
+ )