0

I have a python implementation of a server 'MyServer', which connects to a network over UDP and thus, inherits from DatagramProtocol. This server can connect with the network only using UDP (this cannot be changed due to the network specification). The server runs as an application in the following way:

udp_server = internet.UDPServer(port, server)
application = service.Application("MyServer")
udp_server.setServiceParent(application)

I also have the implementation of a POP3 server. However, this server is connected by the POP3 client via the TCP. I would like to allow my server to also run the POP3 server, something like:

class MyServer(DatagramProtocol):
  def __init__(self, params):
     self.POP3server = POP3Server(params) #my implementation of POP3 server

TCP and UDP are totally different protocols, but maybe there is possibility or a tricky solution to allow a TCP POP3Server run as part of a UDP Server?

Ziva
  • 3,181
  • 15
  • 48
  • 80
  • I don't get it. You say that you have to use UDP and yet you say that a client uses TCP. Or are you simply saying that you want to run two servers? There's no problem with that. Anyway these two protocols don't go together. – freakish Jun 21 '17 at 15:41

1 Answers1

1
from twisted.application.internet import UDPServer, TCPServer

...
UDPServer(port, udp_server).setServiceParent(application)
TCPServer(port, tcp_server).setServiceParent(application)
Jean-Paul Calderone
  • 47,755
  • 6
  • 94
  • 122