Movatterモバイル変換


[0]ホーム

URL:


Muliplexing Socket Connections

Nathan Cassanonathan 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 multiplexmultiple ports. I'm using the select module and sockets to do this. Theproblem is I cannot get the select function to return a file descriptorfrom it's return read list. Does anyone have a simple example of socketmultiplexing or some pointers?import socket, selectsock = 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-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp