I have a small python client which needs a setsockopt after create_socket, but before connect. The non-twisted python code is as follows. How can this be expressed in a twisted environment?
create_socket (socket.AF_INET, socket.SOCK_STREAM)
socket.setsockopt(socket.IPPROTO_IP, 24,1)
socket.bind((clientip, 0))
connect ((serverip,serverport))
In
twistedyou can use thereactor.adoptStreamPort:I don’t really understand your code if you are building a listen socket or connect socket. I assume it is a listen socket.
More details can be found here: http://twistedmatrix.com/documents/12.2.0/api/twisted.internet.interfaces.IReactorSocket.html