이재빈

Recieve Driving Info

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'))