Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
最近、pythonでsocks5サーバーを書こうとしています。ここで見ることができます。
私は質問を考え始めます。ブラウザからの複数のリクエストを処理するにはどうすればよいですか? このバージョンでは、複数のスレッドを使用して処理します。複数のスレッドを使用したくない場合、どうすればコードを設計できますか?
selectモジュールを見てみましょう。特にselect() 関数を見てください。
select
select()
select()かなり低レベルです。もう 1 つの代替手段は、標準の Pythonasyncoreモジュールです。サンプルのエコー サーバーをチェックして、使い方がいかに簡単かを確認してください。
asyncore