A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/074383.html below:

Muliplexing Socket Connections

Muliplexing Socket ConnectionsNathan Cassano nathan at cjhunter.com
Mon Apr 23 13:41:30 EDT 2001
Hello Pythoneers,
    I'm developing a socket server that needs to bind to and multiplex
multiple ports. I'm using the select module and sockets to do this. The
problem is I cannot get the select function to return a file descriptor
from it's return read list. Does anyone have a simple example of socket
multiplexing or some pointers?

import socket, select

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setblocking(0)

print select.select([sock],[sock] ,[] , 0)

...

This is the output that follows

([], [<socket object, fd=3, family=2, type=1, protocol=0>], [])


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4