Desidero avere un servizio twistato (avviato tramite twistd) che ascolta la richiesta TCP/POST su una porta specificata su un indirizzo IP specificato. Ormai ho un'applicazione contorta che ascolta la porta 8040 su localhost. Funziona bene, ma voglio solo ascoltare un determinato indirizzo IP, ad esempio 10.0.0.78.Intrecciato: come associare un server a un indirizzo IP specificato?
Come gestirlo? Si tratta di un frammento del mio codice:
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)