[Twisted-Python] The opposite function of reactor.listenTCP()
Glyph
glyph at twistedmatrix.com
Fri Mar 30 18:58:09 MDT 2012
On Mar 30, 2012, at 7:43 PM, hz hanks wrote:
> Hi All,
>
> I have a server listen to two ports and run as follows:
>
> reactor.listenTCP(PORT1, file_trans_service.getFileTransCtrlServFactory()
> reactor.listenTCP(PORT2, file_trans_service.getFileTransCtrlServFactory()
> reactor.run()
>
> Now I want to close the function of PORT1, but I just don't find the
> opposite function of reactor.listenTCP(). Anyone can give me a hand?
>
> Best,
> Hanks
listenTCP returns an IListeningPort provider, as documented here <http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IReactorTCP.html#listenTCP>
IListeningPort (documented here: <http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IListeningPort.html>) has a stopListening method that will shut down the socket appropriately.
-glyph
More information about the Twisted-Python
mailing list