On 2018-12-03, Grant Edwards <grant.b.edwa...@gmail.com> wrote:
> How does one reset a TCP connection on Linux?  Note that I want to
> reset the connection, not close it.

Something like the following should work I believe, although I have
not tested it:

    sock.setsockopt(
        socket.SOL_SOCKET,
        socket.SO_LINGER,
        struct.pack('ii', 1, 0)
    )
    sock.close()

Possibly you might want a sock.shutdown(socket.SHUT_RDWR) before
the close().
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to