2021-02-11 17:36:40 -05:00
|
|
|
import socket
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
HOST = "192.168.10.128" # The server's hostname or IP address
|
|
|
|
PORT = 80 # The port used by the server
|
2021-02-11 17:36:40 -05:00
|
|
|
|
|
|
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
|
|
s.settimeout(None)
|
|
|
|
|
|
|
|
print("Connecting")
|
|
|
|
s.connect((HOST, PORT))
|
|
|
|
|
|
|
|
print("Sending")
|
2021-03-15 09:57:36 -04:00
|
|
|
s.send(b"Hello, world")
|
2021-02-11 17:36:40 -05:00
|
|
|
|
|
|
|
print("Receiving")
|
|
|
|
data = s.recv(1024)
|
2021-03-15 09:57:36 -04:00
|
|
|
print("Received", repr(data))
|