Hi Wilfried,

Thanks for the reply.

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

I am having troubles. 

I set the ip address of the TWSocket (UDP) to the correct address.
(192.168.243.1)

If I call listen and then try to send I get an error 10049 (Bind Address not
available)
If I call connect and then send, I see the data at the other end but I do
not get any response in the DataAvailable callback.
If I open a second TWSocket to listen I get a callback.

My error?

Ciao,

Mark



 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Wilfried Mestdagh
Sent: Monday, March 31, 2008 2:01 AM
To: ICS support mailing
Subject: Re: [twsocket] UDP Newbie...

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

-- 
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