简体   繁体   English

如何在Linux上的Python 2.7中绑定已经存在的套接字?

[英]How can I bind already existing socket in Python 2.7 on Linux?

How can I sending packets through socket which I already created in my browser? 如何通过已经在浏览器中创建的套接字发送数据包? I don't want to create new socket in Python, only bind socket as I mentioned earlier. 我不想在Python中创建新的套接字,仅像我前面提到的那样绑定套接字。

You cannot overtake an existing TCP connection from within another process without cooperation of the original process. 如果没有原始进程的配合,则不能从另一个进程中接管现有的TCP连接。 With cooperation there are at least on UNIX like systems ways to transfer open file descriptors between processes. 通过合作,至少在类似UNIX的系统上存在在进程之间传输打开文件描述符的方法。 But to get this cooperation you would need to make changes to the browser. 但是要获得这种合作,您需要对浏览器进行更改。

But, your problem sounds like an XY problem . 但是,您的问题听起来像是XY问题 You should better ask about the original issue leading to this question. 您最好询问导致该问题的原始问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何删除 python 2.7,因为我已经在 ubuntu 上安装了 3.6.5? - How can i remove python 2.7 as i already have 3.6.5 installed on ubuntu? 如何与 Python 中已经运行的 Linux 进程通信? - How can I communicate with an already running Linux process in Python? 如何在Linux centOS中使用python将原始套接字绑定到特定接口? - How to bind a raw socket to a specific interface using python in linux centOS? 在Linux SUSE或RedHat上,如何加载Python 2.7 - On linux SUSE or RedHat, how do I load Python 2.7 如何使用Python 2.7(可能还有pyserial)检查Linux中的串口是否已经打开(通过其他进程)? - How to check if serial port is already open (by another process) in Linux, using Python 2.7 (and possibly pyserial)? Python2.7 套接字错误 37“操作已在进行中” - Python2.7 socket error 37 "Operation already in progress" Python Sockets - 将套接字绑定到 IP 后如何获取该套接字的 IP 地址 - Python Sockets - how can I get the IP Address of a Socket after I bind it to an IP scrapy需要python 2.7,但我已经拥有了 - scrapy requires python 2.7 but i already have Python 2.7 / Linux:套接字库绑定类型错误 - Python 2.7 / Linux: socket library binding type error 当我已经在Linux上设置PYTHON变量时,如何解决“找不到Python可执行文件”错误 - How to fix “Can't find Python executable” error while already I set the PYTHON variable on Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM