![]() Then there's the whole blocking-operation-GIL issue too. Since Python's got so much overhead, multithreaded apps are a big point of debate. Print 'We have a connection with ', adress Sock_lst.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) Sock_lst.append(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) import socket, selectįor item in port_wan, port_mob, port_sat: ![]() This is an example of how it can be done. Print 'Could not open socket: ' + messageĪccepted_socket, adress = listening_socket.accept()Īccepted_nd('Hello, and goodbye.') Listening_tsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) Listening_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) The simple server can look something like this. How can I make a simple server(simple as in accepting a connection and print to terminal whatever is received) accept connection from multiple ports or a port range?ĭo I have to use multiple threads, one for each bind call.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |