2

I've developed a websocket server on Twisted with autobahn lib. Now I want to run it as a daemon with twistd. In case of simple TCP server I would do something like that:

application = service.Application("someapp") # create the Application someService = internet.TCPServer(port, someFactory) # create the service someService.setServiceParent(application) 

In that example I'm useing TCPServer class instead of reactor.listenTCP function.

In autobahn api reference I found only listenWS function (like listenTCP for TCP server) and nothing about WSServer class.

So my question is how can I get my app work with twistd? Maybe I should implement my own service WSServer class that extends twisted Service class?

1 Answer 1

3

Yep. Create your own service. Call listenWS in its startService method. Call the shutdown method in the stopService method.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.