[Twisted-Python] Re: Binding echo server to a particular ip address

Morrow, Paul Paul.Morrow at loyaltyworks.com
Wed May 14 14:03:36 EDT 2003


-----Original Message-----
From: W.J. [mailto:miathan at goliath.darktech.org] 
Sent: Wednesday, May 14, 2003 1:48 PM
To: twisted-python at twistedmatrix.com
Subject: [Twisted-Python] Re: Binding echo server to a particular ip

> The following is your simpleserv.py echo server example.  On a 
> multihost (multiple ip addresses) server, how would I have it listen 
> on a particular ip address?

> def main():
>     """This runs the protocol on port 8000"""
>     factory =3D protocol.ServerFactory()
>     factory.protocol =3D Echo

>     reactor.listenTCP(8000,factory)

reactor.listenTCP(8000, factory, interface="")

Where is the interface you want to bind to.
Almost too easy uh?

>     reactor.run()


Twisted-Python mailing list
Twisted-Python at twistedmatrix.com

More information about the Twisted-Python mailing list