0
A
回答
1
在Linux上,你可以用xinetd
来做到这一点。您编辑/etc/services
为您的端口命名,然后添加一行到/etc/xinetd.conf
以在有人连接到该服务时运行您的服务器。 TCP连接将作为其标准输入和输出提供给Python脚本。
+0
是啊我实际上在virtualbox上使用linux,所以我认为这可以帮助我感谢 –
+0
嘿,这很整洁! – Blorgbeard
相关问题
- 1. Python套接字服务器与选择
- 2. Python:异步TCP套接字服务器
- 3. Python Mutliprocessing TLS套接字服务器
- 4. 线程服务器套接字在python
- 5. Python SSL套接字服务器
- 6. Python服务器客户端套接字
- 7. 像Tcl“套接字服务器”套接字服务器框架
- 8. Python套接字客户端到Java套接字服务器
- 9. 彗星与PHP套接字服务器?
- 10. 与TCP套接字(服务器)通信
- 11. TLS与PHP服务器套接字
- 12. 套接字服务器
- 13. Silverlight服务器套接字
- 14. Java服务器套接字
- 15. Python 3 concurrent.futures套接字服务器与ThreadPoolExecutor但不是ProcessPoolExecutor
- 16. 与Python套接字服务器(Chrome扩展)通信
- 17. 如何解决Python套接字/套接字服务器连接[Errno 10048]&[Errno 10049]?
- 18. 套接字服务器未与JavaScript套接字客户端连接
- 19. 连接NodeMCU Lua套接字客户端与node.js套接字服务器
- 20. 客户端套接字接受的数据与服务器套接字不同
- 21. Java套接字/服务器编程:套接字未连接
- 22. C#套接字监听器(服务器)
- 23. 用python套接字连接到IRC服务器
- 24. 用于多连接处理的Python套接字服务器
- 25. Python套接字 - 通过客户端保持与活动服务器的连接
- 26. 通过TCP与c + +(套接字服务器)conect android(套接字客户端)
- 27. Android服务与套接字编程
- 28. Web服务与套接字编程
- 29. 套接字编程与Web服务?
- 30. C套接字服务器,Java套接字客户端:阻塞!
这不是它的工作原理。你必须先运行你的程序,并让它开始监听一个端口。你不能告诉操作系统“听这个端口,然后运行这个程序来处理与它的任何连接”。 – Blorgbeard
也可以工作,但我该怎么做? –
Python使它变得非常简单。看看这里:https://docs.python.org/2/howto/sockets.html – Blorgbeard