Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: UDPClient how to receive data form server?


This question is answered.


Permlink Replies: 4 - Last Post: Jan 30, 2018 6:33 PM Last Post By: James L Threads: [ Previous | Next ]
James L

Posts: 33
Registered: 8/3/03
UDPClient how to receive data form server?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2018 8:46 AM
Hello sir,

UDPClinet how to receive data from UDPServer?

Thank you,

James
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: UDPClient how to receive data form server?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2018 9:26 AM   in response to: James L in response to: James L
James L wrote:

UDPClinet how to receive data from UDPServer?

Which UDP component(s) are you using? TIdUDPClient and TIdUDPServer
from Indy? or something else?

--
Remy Lebeau (TeamB)
James L

Posts: 33
Registered: 8/3/03
Re: UDPClient how to receive data form server?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2018 5:34 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
James L wrote:

UDPClinet how to receive data from UDPServer?

Which UDP component(s) are you using? TIdUDPClient and TIdUDPServer
from Indy? or something else?

--
Remy Lebeau (TeamB)

I use TIdUDPClient and TIdUDPServer, TIdUDPServer can receive data from TIdUDPClient.
Is possible TIdUDPServer send data to TIDClient?

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: UDPClient how to receive data form server?
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2018 6:09 PM   in response to: James L in response to: James L
James L wrote:

I use TIdUDPClient and TIdUDPServer

TIdUDPClient has several overloaded ReceiveBuffer() and ReceiveString()
methods. Do you look at any of them yet?

TIdUDPServer can receive data from TIdUDPClient.

UDP is connectionless, so it is possible to have:

1. a TIdUDPClient communicate with a TIdUDPServer

2. a TIdUDPClient communicate with another TIdUDPClient

3. a TIdUDPServer communicate with another TIdUDPServer

Is possible TIdUDPServer send data to TIDClient?

Yes, of course. TIdUDPClient just doesn't have an OnUDPRead event,
like TIdUDPServer does. So, you would have to call ReceiveBuffer() or
ReceiveString() when you know you are expecting data, such as after
sending something to TIdUDPServer first. Or, if you don't know when
data will arrive, call ReceiveBuffer() or ReceiveString() at regular
intervals, such as in a timer or thread, or replace TIdUDPClient with
TIdUDPServer so you can use its OnUDPRead event.

--
Remy Lebeau (TeamB)
James L

Posts: 33
Registered: 8/3/03
Re: UDPClient how to receive data form server?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2018 6:33 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thank you, i will try it
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02