Python Forum
socket without blocking loop and automatically retrieve data from the port
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
socket without blocking loop and automatically retrieve data from the port
#4
A solution that I have used in the pass is to create a socketserver.ThreadingTCPServer instance and launch a thread that runs the server's serve_forever() method. One needs to create a subclass of socketserver.StreamRequestHandler with a handle() method that does something useful.Once the server is launched, the main thread can do anything it wants and the socketserver will handle connections and requests in other threads as they arrive.
Reply


Messages In This Thread
RE: socket without blocking loop and automatically retrieve data from the port - by Gribouillis - Jun-21-2020, 10:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Socket to stream data and tranmit and revieve data kiyoshi7 0 2,365 Aug-11-2022, 10:52 PM
Last Post: kiyoshi7
  how to split socket data onto multiple clients for separate processing ConcealedFox70 0 1,932 Jan-11-2022, 08:26 PM
Last Post: ConcealedFox70
  Help with socket library for a port scanner? xanderv 1 2,320 Jan-03-2021, 10:48 PM
Last Post: Larz60+
  Clarification on how to set up non-blocking socket connection Shaggy 1 1,974 Oct-14-2020, 07:57 PM
Last Post: Skaperen
  Using BaseHTTPServer to encounter system blocking zzs027 0 2,739 Mar-05-2020, 01:39 PM
Last Post: zzs027
  TCP socket, data transnission Simba 4 3,269 Dec-07-2019, 03:15 PM
Last Post: Simba
  socket loop problem monamour 9 6,666 Nov-28-2019, 12:04 PM
Last Post: buran
  Soft Access Point & Socket Data Streaming groger57 1 2,516 Aug-01-2019, 02:53 PM
Last Post: groger57
  Send data BMP180 between client and server trought module socket smalhao 0 2,834 Jul-30-2018, 12:56 PM
Last Post: smalhao
  Python socket : Error receive data quanglnh1993 1 13,012 Mar-14-2018, 11:59 AM
Last Post: avorane

Forum Jump:

User Panel Messages

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