2

I've been looking around on the net now for quite a while and while a lot of documentation refers to strports and point to Twisted website I can't find anything on there which actually explains what the syntax is.

Does anyone know of a document that describes the syntax for strports?

Bicker x 2
  • 137
  • 8

1 Answers1

3

There's probably some confusion here, and maybe this isn't exactly the answer you're looking for. But it's the answer I'd rather you were looking for, so I hope that's good enough. ;)

strports is an older, non-extensible API that lets you create services. This is the twisted.application.strports module. Much of it is now deprecated.

endpoints is a newer, extensible API that lets you create clients or servers and comes with a little helper that also lets you create services for these. This is the twisted.internet.endpoints module. You should prefer to use it over strports for various reasons.

Endpoints are documented in http://twistedmatrix.com/documents/current/core/howto/endpoints.html. Near the end are some examples demonstrating all of the endpoints distributed with Twisted Core (ie, ignoring all of the subprojects). It so happens that Twisted Conch now offers an endpoint as well, documented separately in http://twistedmatrix.com/documents/current/conch/howto/conch_client.html.

The documentation can't be exhaustive since the system is extensible via plugins - you may find other projects implement and provide other kinds of endpoints.

Jean-Paul Calderone
  • 47,755
  • 6
  • 94
  • 122
  • Thanks for this BuildBot still uses strports (according to the docs for 8.7) for it's web server instance. Hence the question although it appears to be the same syntax. I'll have look, and maybe nudge the BuildBot developers to change their docs – Bicker x 2 Jul 09 '13 at 12:17
  • 1
    Informally, "`strports`" still informally refers to the syntax, since `twisted.application.strports.service` still exists and is supported. More precisely though, it's "*endpoint description syntax*", as explained in the API documentation: http://twistedmatrix.com/documents/13.1.0/api/twisted.internet.endpoints.serverFromString.html – Glyph Jul 10 '13 at 20:51
  • It refers to *something*, but I wish people would stop saying it. The old syntax was *different* and if you pass it to `twisted.application.strports.servive`, you'll get a deprecation warning telling you to use a different syntax. And none of the new endpoints were available using the old syntax, though they're available if you use the new syntax with `twisted.application.strports.service`. – Jean-Paul Calderone Jul 11 '13 at 10:19