Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8376091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:20:39+00:00 2026-06-09T15:20:39+00:00

A closed client socket appended into elist, but there is no exception in ex

  • 0

A closed client socket appended into elist, but there is no exception in ex when select called. I don’t known why, can you help me please. Thanks so much!

r,w,ex = select.select(rlist, wlist,elist )
    for s in ex:
       print "catch a closed socket error!"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:20:40+00:00Added an answer on June 9, 2026 at 3:20 pm

    To catch a socket being closed event you need to have the socket in rlist. When a connection is closed on the other side, select returns and denotes that the closed socket is ready for reading (i.e. it’s in you r list). If you perform recv on this socket and it returns an empty list (nothing has been read), it means a connection has been closed.

     data = s.recv(size) 
     if not data: 
        # socket has been closed by peer
        s.close()
    

    From what I have seen, the exception list (the last parameter of select) isn’t widely used. The main problem with it is that different OSes interpret this parameter differently. Sometimes it’s even used only for cases that don’t seem to be exceptions at all (OOB data).

    socket module documentation isn’t specific about what that argument means, so it’s generally not a good idea to rely on it:

    xlist: wait for an “exceptional condition” (see the manual page for
    what your system considers such a condition)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code (my c++ socket server) but I don't know How can I
When the server socket is closed the client doesn't receive any exception even after
How can I know when to close the socket of an HTTP client (I
How is a socket used by an HTTP client properly closed after transmitting the
I wanna kill the TCP connection listener thread(serverside) after client closes the socket.. The
Why does this port/socket close once a connection has been made by a client?
I'm trying to write a client/server program with threads. I close the socket once
I am working on customizing a closed source client application. It has a tree
Possible Duplicates: What is REST?[closed] Does the WCF REST WebChannelFactory client support REST services
I created a server-client application using the asynchronous socket. I found the problem when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.