mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-12-18 16:20:17 +00:00
10 lines
263 B
Python
10 lines
263 B
Python
|
|
||
|
import socket
|
||
|
|
||
|
client_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
||
|
port = 1024
|
||
|
host = socket.gethostbyname(socket.gethostname()) # get the hostname
|
||
|
client_socket.connect((host, port))
|
||
|
message = client_socket.recv(2048)
|
||
|
print(message.decode("utf-8"))
|