<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jun 4, 2011, at 11:32 PM, Martin v. Löwis wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: 'Bitstream Vera Sans Mono'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">b) telling people to use Twisted or asyncore on the server side<br>&nbsp;&nbsp;if they are new to sockets is bad advice. People *first* have<br>&nbsp;&nbsp;to understand sockets, and *then* can use these libraries<br>&nbsp;&nbsp;and frameworks. Those libraries aren't made to be black boxes<br>&nbsp;&nbsp;that work even if you don't know how - you *have* to know how<br>&nbsp;&nbsp;they work inside, or else you can't productively use them.<br></span></span></blockquote></div><div><br></div><div>First, Twisted doesn't always use the BSD sockets API; the Windows IOCP reactor, especially, starts off with the socket() function, but things go off in a different direction pretty quickly from there. &nbsp;So it's perfectly fine to introduce yourself to networking via Twisted, and many users have done just that. &nbsp;If you're using it idiomatically, you should never encounter a socket object or file descriptor poking through the API anywhere. &nbsp;Asyncore is different: you do need to know how sockets work in order to use it, because you're expected to call .send() and .recv() yourself. &nbsp;(And, in my opinion, this is a serious design flaw, for reasons which will hopefully be elucidated in the PEP that Laurens is now writing.)</div><div><br></div><div>Second, it makes me a little sad that it appears to be folk wisdom that Twisted is only for servers. &nbsp;A lot of work has gone into making it equally appropriate for clients. &nbsp;This is especially true if your client has a GUI, where Twisted is often better than a protocol-specific library, which may either be blocking or have its own ad-hoc event loop.</div><div><br></div><div>I don't have an opinion on the socket HOWTO per se, only on the possibility of linking to Twisted as an alternate implementation mechanism. &nbsp;It really would be better to say "go use Twisted rather than reading any of the following" than "read the following, which will help you understand Twisted".</div><div><br></div><div><br></div></body></html>