S
S
Sergey Grigorov2018-05-12 11:44:28
Python
Sergey Grigorov, 2018-05-12 11:44:28

How to use multiple web socket servers in Python 3?

Hello.
There are several socket servers.
127.0.0.1:6677 - socket server for searching files
127.0.0.1:6678 - request handler server
localhost:8000 - CGI scripts + web

snout then a socket connection is opened with 127.0.0.1:6678, it accepts the request and sends it to the Moscow server. In our case, this is 127.0.0.1:6677.
Then it takes a list of files with brief information about them from 127.0.0.1:6677 and sends it to the web muzzle for output.

But when 2 servers and a web muzzle are running on the same machine (which is why there is only one IP everywhere), then you can wait for a response from the servers for years, but it will never come.
Moreover, if you cut down one of the servers, the request instantly "finds its way" to the web muzzle, albeit with an empty result.

How can this be overcome? I think that this is due to the opening of several socket connections between each other on the local machine, but I don’t know how to overcome it.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question