<reponame>appinho/SASelfDrivingCar<gh_stars>1-10
#!/usr/bin/env python3

import socket

# HOST = '127.0.0.1'  # Standard loopback interface address (localhost)
HOST = '192.168.0.100'  # Standard loopback interface address (localhost)
PORT = 65432        # Port to listen on (non-privileged ports are > 1023)
#PORT = 8000

hostname = socket.gethostname()
# getting the IP address using socket.gethostbyname() method
ip_address = socket.gethostbyname(hostname)
print(ip_address)

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT))
s.listen(1)
print("Start")
conn, addr = s.accept()
print("accept")
with conn:
    print('Connected by', addr)
    while True:
        data = conn.recv(1024)
        if not data:
            break
        conn.sendall(data)

#!/usr/bin/env python3

import socket

# HOST = '127.0.0.1'  # Standard loopback interface address (localhost)
HOST = '192.168.0.100'  # Standard loopback interface address (localhost)
PORT = 65432        # Port to listen on (non-privileged ports are > 1023)
#PORT = 8000

hostname = socket.gethostname()
# getting the IP address using socket.gethostbyname() method
ip_address = socket.gethostbyname(hostname)
print(ip_address)

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT))
s.listen(1)
print("Start")
conn, addr = s.accept()
print("accept")
with conn:
    print('Connected by', addr)
    while True:
        data = conn.recv(1024)
        if not data:
            break
        conn.sendall(data)
#!/usr/bin/env python3 # HOST = '127.0.0.1'  # Standard loopback interface address (localhost) # Standard loopback interface address (localhost) # Port to listen on (non-privileged ports are > 1023) #PORT = 8000 # getting the IP address using socket.gethostbyname() method