Small problem with messages sent via Internet - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Small problem with messages sent via Internet

Well, if somebody still remembers, I am making a modified version of [b]SimpleTCP 2[/b]. I have now added new Component, serverClient which is used on server instead of TSimpleTCPClientm. But this is not the problem.

Problem is this: When [b]2 messages are sent at the same time[/b] or atleast nearly the same time, there will be a problem. (Client sends message to server and server to client) When these messages are sent, both the client and server, will 'broke'.
When message is received, they will see whether they can sent a confirmation. But if message was just sent, no confirmation can be sent before one is received. Here is a simple version of normal message sending:
Server<==Confirmation+Client's message<==Client
Server==>Confirmation+Server's message==>Client

Now both are in [b]'ready'[/b] status. But see this:

Server<==Client's message<==Client

Server is waiting for confirmation, just like the Client. [b]How do I solve this problem?[/b] I could make a timer to see whether no data have been sent lately and send one extra Confirmation but it would be just a route around this.
Sign In or Register to comment.