Socket Stream(lit) This code implements wireless TCP socket communication between a server and client - written in pure python with a user interface for both computers. To recreate what ive done here you'll need two laptops and a network to communicate over. Make sure your IP addresses and subnet masks are correct and networkable.
This code uses the following libraries:
streamlit
: For creating the user interfacesocket
: For handling the system level communication hardware
Clone the repository on two computers and install the necessary dependencies using pip. Next, run the streamlit apps in a terminal in the directory of the repositories
on the server computer:
streamlit run server.py
on the client computer:
streamlit run client.py
The app as follows:
- The server waits for a connection
- The client connects to the server
- The client waits for text input from the user
- The client send the user data to the server
- The server displays the data as text and responds with a received message
- The server continually waits for another message
- The client saves the socket connection but reruns and only displays the most recent message and server response
Python | Wifi | wireless communication | sockets | TCP | networking
decode bytes | communication | custom classes
Self taught coding | Mechanical engineer | Robotics engineer
Brian Lesko | Brian Joseph Lesko
╭━━╮╭━━━┳━━┳━━━┳━╮╱╭╮ ╭╮╱╱╭━━━┳━━━┳╮╭━┳━━━╮ ┃╭╮┃┃╭━╮┣┫┣┫╭━╮┃┃╰╮┃┃ ┃┃╱╱┃╭━━┫╭━╮┃┃┃╭┫╭━╮┃ ┃╰╯╰┫╰━╯┃┃┃┃┃╱┃┃╭╮╰╯┃ ┃┃╱╱┃╰━━┫╰━━┫╰╯╯┃┃╱┃┃ ┃╭━╮┃╭╮╭╯┃┃┃╰━╯┃┃╰╮┃┃ ┃┃╱╭┫╭━━┻━━╮┃╭╮┃┃┃╱┃┃ ┃╰━╯┃┃┃╰┳┫┣┫╭━╮┃┃╱┃┃┃ ┃╰━╯┃╰━━┫╰━╯┃┃┃╰┫╰━╯┃ ╰━━━┻╯╰━┻━━┻╯╱╰┻╯╱╰━╯ ╰━━━┻━━━┻━━━┻╯╰━┻━━━╯
follow all of these or i will kick you