Hello Mark,

> 1. Do I need two TWSocket? One to send and one to listen?

No you set it to Listen, and you can send and receive with the same.

> 2. Since this is broadcast, will I receive the data I transmit in the
> OnDataAvaliable callback?

Yes if you broadcast then you send to yourself also. Since UDP is not
reliable it could be possible that you don't receive it yourself,
because while you are sending you are not receiving :)

> 3. Lots of computers will be sending data how do I determine the source (IP
> address) of the data in the OnDataAvaliable callback?

Please take a look at ReceiveFrom method.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Monday, March 31, 2008, 03:36, zayin wrote:


> Hi,

> I am new to programming for UDP, always used TCP, and I have searched for
> answers to some basic questions without joy. Hopefully there are quick
> questions to answer.

> When using TCP and I am the client I use a TWSocket, connect and use the
> object to send and receive data.

> When using TCP and I am the server I use TWSocketServer to listen and when
> OnClientCreate is called it passes an object of my class derived from
> TWSocketClient and I use the object to send and receive data.

> In most cases I am the client for this new program using UDP. Sometimes
> another program may send unsolicited data.

> 1. Do I need two TWSocket? One to send and one to listen?
> 2. Since this is broadcast, will I receive the data I transmit in the
> OnDataAvaliable callback?
> 3. Lots of computers will be sending data how do I determine the source (IP
> address) of the data in the OnDataAvaliable callback?
> 4. Any advice about using UDP?

> Ciao,

> Mark



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to