Twisted: how-to bind a server to a specified IP address? (solved)

Posted by daccle on Stack Overflow See other posts from Stack Overflow or by daccle
Published on 2010-04-20T11:53:40Z Indexed on 2010/04/20 12:13 UTC
Read the original article Hit count: 134

Filed under:
|

I want to have a twisted service (started via twistd) which listens to TCP/POST request on a specified port on a specified IP address. By now I have a twisted application which listens to port 8040 on localhost. It is running fine, but I want it to only listen to a certain IP address, say 10.0.0.78.

How-to manage that? This is a snippet of my code:

application = service.Application('SMS_Inbound')

smsInbound = resource.Resource()
smsInbound.putChild('75sms_inbound',ReceiveSMS(application))
smsInboundServer = internet.TCPServer(8001, webserver.Site(smsInbound))
smsInboundServer.setName("SMS Handling")
smsInboundServer.setServiceParent(application)

© Stack Overflow or respective owner

Related posts about python

Related posts about twisted