I implemented a code that sends pings to different destinations in a continuous way, but after a 10-hour run cycle, the socket I use depends on some kind of aging, which causes the application to stop using "[Errorno 105] There is no free space in the buffer" . How to MONITOR and SOLVE this problem?
Just for information, after opening, I always use the same socket to send and receive messages: can the socket periodically solve the problem?
SENDER CODE
import socket icmp = socket.getprotobyname('icmp') self.socket = socket.socket(socket.AF_INET,socket.SOCK_RAW,icmp) for target in target_list:
RECEIVER CODE
import select whatReady = select.select([self.socket],[],[]) if whatReady[0] != []: for skt in whatReady[0]: #... (recPacket,addr) = self.socket.recvfrom(self.PACKET_SIZE+64)
NOTES:
self.socket is the same object reference for both modules.- I never close or change
self.socket at runtime. - self.PACKET_SIZE = 32 (bytes)
source share