FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-beginner-projects/projects/Socket/client.py at patch-2 · kodingkin/python-beginner-projects · GitHub
kodingkin
/
python-beginner-projects
Public
forked from
Mrinank-Bhowmick/python-beginner-projects
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-beginner-projects
/
projects
/
Socket
/
client.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (9 loc) · 402 Bytes
Breadcrumbs
python-beginner-projects
/
projects
/
Socket
/
client.py
Copy path
File metadata and controls
14 lines (9 loc) · 402 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import
socket
HOST
=
'localhost'
# host where the server is located
PORT
=
3000
# port the server is on
s
=
socket
.
socket
()
# new socket with name s
s
.
connect
((
HOST
,
PORT
))
# connection to server
s
.
send
(
b"Hello from client"
)
# send message to server
res
=
s
.
recv
(
1024
)
# buffer size to receive the data sent from the server
print
(
res
)
# print the data
s
.
close
()
# close the connection with server
Back
|
FazBrowse Home
|
New Git URL