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 6534183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:13:13+00:00 2026-05-25T10:13:13+00:00

I am binding a socket to localhost:8888, in order to make a simple server.

  • 0

I am binding a socket to localhost:8888, in order to make a simple server.
Here is the simple python script that I used to create the server.

import os
import socket
import fcntl

tuples = socket.getaddrinfo('localhost', 8888, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE | socket.AI_ADDRCONFIG)

res = tuples[0]

af, socktype, proto, canonname, sockaddr = res
sock = socket.socket(af, socktype, proto)

flags = fcntl.fcntl(sock.fileno(), fcntl.F_GETFD)
flags |= fcntl.FD_CLOEXEC
fcntl.fcntl(sock.fileno(), fcntl.F_SETFD, flags)

sock.setblocking(0)        
sock.bind(sockaddr)
sock.listen(128)
  1. Now I open this script using an interactive shell.
  2. Then I go to my browser, and visit http://localhost:8888, which should queue up a connection to my server.
  3. I repeat the last step a few more times,
    each time inside a new tab.

At this point, I expect to have many connections queued up for my server.

To check this, I go into my interactive shell and I type:

sock.accept()

This works on the first try, but on subsequent tries I get Erno 11 (EAGAIN), which tells me that no other connections are queued up. However, in my browser, the little “Connecting” spinner is still going on each tab I opened! I have tried this in both Chrome and Firefox.

I my wrote my own client that connects to localhost:8888, and was able to queue up connections with no problems. What is going on here?? Can anyone please check if this experiment can be verified on their own browsers?

For convenience, here is my client:

import os
import socket
import fcntl

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 8888))
s.recv(1000)
  • 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-05-25T10:13:13+00:00Added an answer on May 25, 2026 at 10:13 am

    It is likely an optimisation on the side of your browser, trying to reuse the same connection – see http://en.wikipedia.org/wiki/HTTP_persistent_connection.

    If you want to make sure, sniff the traffic using wireshark, although your localhost based address may require some fancy setup.

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

Sidebar

Related Questions

I'm trying to create a binding from my custom control to objects that are
Here's my binding source object: Public Class MyListObject Private _mylist As New ObservableCollection(Of String)
Here total two union binding three queries, first query retrieving records from a virtual
How to make the Haskell GLUT binding using freeglut instead of the original GLUT
Binding a List collection to a datagrid. How can you limit what properties will
I'm binding a datatable to a gridview control, and when I format each column
I am binding the dropdown with db entity. ddlCustomer.DataSource = Customer.GetAll(); ddlCustomer.DataTextField = CustomerName;
I am binding an SPGridView to a SPList. As code samples suggest, I am
I am binding a generic List to an <asp:ListView /> control to display a
I am binding a List to a DataGridView. One property of the SomeObject class

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.