Commit 22603e92 authored by david's avatar david
Browse files

flake8 on server.py

parent 680e85e4
Pipeline #623 passed with stage
in 12 seconds
#authors : Julien David & Ismail MOUMNI
# 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
# BINDING
serv.bind((address, PORT))
# Listening to 1 CLient
serv.listen()
#accepting the connection from client and getting client IP
# 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)
# 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()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment