Has anyone created a simple POP3 and SMTP server using TWISTED?

Donn Cave donn at u.washington.edu
Mon Mar 17 17:45:44 EST 2003


Quoth "Steve Holden" <sholden at holdenweb.com>:
| "Donn Cave" <donn at drizzle.com> wrote in message
| news:1047616632.623178 at yasure...
...
|> But there are some limitations.  One that comes to mind is that an
|> open socket doesn't survive across a fork, so you may want to start
|
| If this is so, how does inetd work?

Doesn't.

|> with a single-threaded server that deals with each connection one
|> by one.  That should work for POP and SMTP, though probably will need
|> a select with timeout in front of all reads, so the occasional stuck
|> client doesn't jam the works.
|
| I'm not sure I can agree with this. Are you suggesting that it isn't
| possible to concurrently handle multiple connections to the same server
| port, or am I misunderstanding?

That is indeed possible - it's Berkeley sockets to that extent.  The 
problem is only that without fork, you need to use threads, and that
adds some implementation problems that it seems to me you might
profitably postpone until at least the 2nd generation.  Unless multi-
threaded programs are second nature to you already, but then in that
case you'd probably disregard my advice anyway.  (Using "you" in the
impersonal sense.)

	Donn Cave, donn at u.washington.edu




More information about the Python-list mailing list