Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rdos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien David
rdos
Commits
cf9bbcee
Commit
cf9bbcee
authored
4 years ago
by
Ismail Moumni
Browse files
Options
Downloads
Patches
Plain Diff
Adding parameter to funciton server_conn
parent
ed4977d6
No related branches found
No related tags found
1 merge request
!2
WIP - 001 - addingserver
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
softwares/server/server.py
+10
-9
10 additions, 9 deletions
softwares/server/server.py
with
10 additions
and
9 deletions
softwares/server/server.py
+
10
−
9
View file @
cf9bbcee
#authors : Ismail MOUMNI
#authors :
Julien David &
Ismail MOUMNI
import
socket
# SERVER PORT
Port
=
9393
# Creating Socket IP4 TCP
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
as
serv
:
#BINDING
serv
.
bind
((
'
127.0.0.1
'
,
Port
))
# Listening to 1 CLient
serv
.
listen
()
#accepting the connection from client and getting client IP
conn
,
addr
=
serv
.
accept
()
def
server_conn
(
address
):
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
(
'
C
LIENT IP ADDRESS
:
'
,
addr
)
print
(
'
C
onnexion acceptée depuis l IP
:
'
,
addr
)
# Receiving Data from Client
data
=
conn
.
recv
(
1024
)
print
(
data
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment