Home > Back-end >  The host signal and the client, but the client does not know when the host signal (environment) the
The host signal and the client, but the client does not know when the host signal (environment) the

Time:10-28

The development of language Delphi;

Function: the host signal, because the client does not know when the host signal (1 minute), the client (around 100) in 1 minutes continuously monitoring signal from the host, according to the signal, the client to make the corresponding action
Network environment: the Internet (wan)
Best precision accurate to seconds,

Before, by the Web server to modify a TXT file, with TIdHTTP client reads a http://www.xxx.com/a.txt, according to the content, but it is to find a client TIdHTTP kept reading has a problem, the host of the Web server will also have a question,

Who still have what way? Used in a local area network (LAN) using Tcp connection, start connection, set up a server host

CodePudding user response:

Host to a client in the Internet to send data, it is necessary to know the address of the client, the client is must pass through ports first connect to the host, the host can take turns to send data to the client, this kind of situation usually use client after active query execution for good, because you don't know what time the client boot, you send the command client didn't boot, customer you have already sent the command when the phone is switched on, the client is missed, antivirus software upgrade is the client the initiative of the query,

CodePudding user response:

TCP connection is possible, WINSOCK strong enough in this aspect,

CodePudding user response:

Use TServerSocket server, the client use TClientSocket, can have the server to the client "radio", as to what circumstances the broadcast, will depending on your situation,

CodePudding user response:

TCP communication cannot be accurate to seconds, you can use the SOCKET connection, and then by service, and actively

CodePudding user response:

Agree with the two upstairs

CodePudding user response:

KHFP...

CodePudding user response:

Host use UDP signals to the client,

CodePudding user response:

UDP packet is unsafe, packet loss

CodePudding user response:

It is easy to solve, can mimic the TCP three-way handshake, the host sends commands, after receipt of the client to have a response, the host received a reply (in the case of this is normal) knew command sends a success, if within a certain time (such as 2 ~ 3 seconds) received no response, just resend once order, haven't received a reply, is considered to be the client or network has a problem, it is ok to record,

CodePudding user response:

Idtcpclient/IdTCPServer cooperate, not to miss one, except, of course, in addition to the connection timeout or, speaking, reading and writing,

CodePudding user response:

Very simple, Idtcpclient/IdTCPServer cooperate, it is ok to set a communication protocol,

CodePudding user response:

You make a simple communication protocol, shake hands/reset/send data/data/end,
  • Related