-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix potential memory leak in
TcpClient::send
- Loading branch information
mikee47
committed
Apr 1, 2024
1 parent
0e46891
commit 3609357
Showing
2 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Test python application to send test message to server | ||
# | ||
# Shows connection detail so we can compare it to Sming code | ||
# | ||
|
||
import argparse | ||
import logging | ||
import asyncio | ||
from websockets.sync.client import connect | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Simple websocket client test') | ||
parser.add_argument('URL', help='Connection URL', default='ws://192.168.13.10/ws') | ||
|
||
args = parser.parse_args() | ||
|
||
logging.basicConfig( | ||
format="%(asctime)s %(message)s", | ||
level=logging.DEBUG, | ||
) | ||
print(f'Connecting to {args.URL}...') | ||
with connect(args.URL) as websocket: | ||
websocket.send("Hello world!") | ||
websocket.recv() | ||
websocket.recv() | ||
|
||
if __name__ == "__main__": | ||
main() |