Python Forum
Python's socket library to implement a simple TCP server and client that communicate
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python's socket library to implement a simple TCP server and client that communicate
#1
Hii community,
I'm working on a project where I need to set up a basic TCP server and client using Python's socket library. The server should listen for incoming connections on a specified port and handle multiple clients, while the client should connect to the and send/receive data. This is the problem iam facing ,give me any suggestions regards this,Thank you. https://19216801.pro/
Reply
#2
I think every document I've seen about Python sockets shows how to write a client and a server, so either you have a question about some detail, or this is really lazy attempt to have someone do your homework. Do you have a question?
Reply
#3
There is more than one way to solve it. I prefer asyncio. If you start learning socket programming, you should use the low-level sockets in the first place. Then you can learn how to handle multiple connections with Threads. After this, you learn, why threaded network programming is bad.

Then you should learn more about select, which tells you if a socket is ready to receive or send data. Then the next step is the modules selectors, which has a better abstraction.

This opens the door to understand how asyncio works in the deepest level.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using the robot class - implement robot battles - Python OOP krnkrnkrn 1 2,505 May-17-2021, 09:19 PM
Last Post: deanhystad
  Math operations from string in a Client-Server over UDP EJay 0 5,060 Oct-30-2018, 12:17 AM
Last Post: EJay
  Implement Python Class jill1978 1 3,127 Oct-08-2018, 06:17 AM
Last Post: buran
  Upload file to server from client oncebuddy 6 7,408 Feb-15-2018, 03:23 PM
Last Post: buran
  Problem with Python 3 socket JChris 3 21,998 Sep-03-2017, 05:20 PM
Last Post: JChris

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020