简体   繁体   中英

connecting to a regular socket server from a web socket server (autobahn)

i am writing an intermediary web socket server so that it can forward messages directly to my existing socket server.

what i am naively thinking is that on the

   def onOpen(self):
      #initialize socket client and run in a while true loop

i can setup the socket client there and listen forever with a while true , and do self.sendMessage(...) for any recv() data received from the socket client back to the websocket client.

would something like this work? are there better ways to do this? what i am worried about is that the while true will be blocking for everyone.

thanks.

AutobahnPython具有内置功能。 通过 WebSocket包装任何现有的基于流的协议(例如VNC,SSH,IRC,IMAP等) 请参见此处

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM