我在下面给出了我的程序。这里我想通过原始套接字从simhost接口接收数据。然后我想把它写进一个缓冲区,但一旦select调用发生,程序执行就会停止并显示键盘中断。我的程序有什么问题?你知道吗
import socket
import select
import sys
import time
from socket import socket, AF_PACKET, SOCK_RAW
s = socket(AF_PACKET, SOCK_RAW)
s.bind(("simhost-eth2", 0))
buffer = []
input = [s]
while 1:
inputready, outputready, exceptready = select.select(input, [], [])
for s in inputready:
l, addr = s.recvfrom(1024)
buffer.append(l)
print buffer
目前没有回答
相关问题 更多 >
编程相关推荐