Python Forum
Using BaseHTTPServer to encounter system blocking
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using BaseHTTPServer to encounter system blocking
#1
BaseHTTPServer encounter system blocking

I write my code to process the http requests using Post method like this
    
def do_POST(self):
    t1 = time.time()
    mpath, margs = urllib.request.splitquery(self.path)
    datas        = self.rfile.read(int(self.headers['content-length']))
then I find that system call was blocked when receiving connection request
I used strace command, it show
Error:
strace: Process 28286 attached recvfrom(4,
used gdb, it show
Error:
0x00007fdc8fb0287f in __libc_recv (fd=4, buf=0x55f39c0, n=8192, flags=0) at ../sysdeps/unix/sysv/linux/x86_64/recv.c:28
How to solve this problem
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Clarification on how to set up non-blocking socket connection Shaggy 1 1,938 Oct-14-2020, 07:57 PM
Last Post: Skaperen
  socket without blocking loop and automatically retrieve data from the port RubenP 3 3,487 Jun-21-2020, 10:59 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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