Skip to content
Snippets Groups Projects
Commit 40b89ddb authored by Julien David's avatar Julien David
Browse files

Merge branch '001-Addingserver' into 'master'

WIP - 001 - addingserver

See merge request !2
parents 09905551 082bcb49
No related branches found
No related tags found
1 merge request!2WIP - 001 - addingserver
Pipeline #609 failed
#authors : Julien David & Ismail MOUMNI
import socket
# SERVER PORT
__RDOS_Port__ = 9393
# Creating Socket IP4 TCP
def server_conn(address, PORT):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as serv:
#BINDING
serv.bind((address,PORT))
# Listening to 1 CLient
serv.listen()
#accepting the connection from client and getting client IP
conn, addr = serv.accept()
with conn:
# Sending
conn.send(bytes("Bonjour !!","utf-8"))
print('Connexion acceptée depuis l IP : ',addr)
# Receiving Data from Client
data = conn.recv(1024)
print(data)
serv.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment