Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Julien David
rdos
Commits
22603e92
Commit
22603e92
authored
Sep 08, 2020
by
david
Browse files
flake8 on server.py
parent
680e85e4
Pipeline
#623
passed with stage
in 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
softwares/server/server.py
View file @
22603e92
#
a
uthors : Julien David & Ismail MOUMNI
#
A
uthors : 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
()
#
a
ccepting the connection from client and getting client IP
#
A
ccepting 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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment