Showing
1 changed file
with
18 additions
and
0 deletions
Modules/Human_recognition_Edge.py
0 → 100644
1 | +import socket | ||
2 | +PORT = 9999 | ||
3 | +server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
4 | + | ||
5 | +server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1) | ||
6 | +server_socket.bind(('',PORT)) | ||
7 | + | ||
8 | +server_socket.listen(1) | ||
9 | + | ||
10 | +client_socket,addr = server_socket.accept() | ||
11 | + | ||
12 | +print('Connected by', addr) | ||
13 | + | ||
14 | +while True: | ||
15 | + data = client_socket.recv(1024) | ||
16 | + if not data: | ||
17 | + pass | ||
18 | + print('Recieved from', addr, data.decode('utf-8')) |
-
Please register or login to post a comment