H
hisan
Hi All,
I want to open a socket connection and keep it alive for ever or until i explicitly close the socket connection.
below is my code though i have set keep alive flag the socket gets closed after some time .please help me out here
sb_sock = socket.socket(socket.AF_INET,
socket.SOCK_STREAM,socket.SOL_TCP)
sb_sock.setsockopt( socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
sb_sock.connect((msg_host, host_port))
sb_sock.send(reg_msg)
I want to open a socket connection and keep it alive for ever or until i explicitly close the socket connection.
below is my code though i have set keep alive flag the socket gets closed after some time .please help me out here
sb_sock = socket.socket(socket.AF_INET,
socket.SOCK_STREAM,socket.SOL_TCP)
sb_sock.setsockopt( socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
sb_sock.connect((msg_host, host_port))
sb_sock.send(reg_msg)