V
V
Vitaly2017-05-18 09:52:49
JavaScript
Vitaly, 2017-05-18 09:52:49

How to restart socket io on client side with changed parameters?

All the best! How to implement so that when you change the port or host, sokcet of the server on the client side, you can change the settings on the client side and restart the socket?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-05-18
@BorisKorobkov

Without punctuation, it's just a loosely connected stream of consciousness.
Port/host changes on the server, but restart the client?
1. Send emit to all clients from the old socket server. For example, 'reconnect' and a new address
2. Stop the old socket server (you don't have to stop)
3. Start a new socket server
4. On the client, make sure that when 'reconnect' is received, the old connection is closed and a new one is opened

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question