Skip to content Skip to sidebar Skip to footer

Just Get One Last Value From Socket

I send data to socket on one side every second, but I can read that data on another side in any moment. Here's the writer: from settings import Config filename = Config.NAVIGATION

Solution 1:

I think that you are using the solution in reverse.

Instead of pushing messaging, while not pulling messages ?

Your server may look like:

  1. Wait for a connection
  2. Give a random message
  3. go to step 1

And your client may just connect to the server when he needs a message.

In your case, the connection is "opened all the time", in my solution the socket is opened only when needed. and closed right after the message is delivered.

Post a Comment for "Just Get One Last Value From Socket"