Anders Backman - 2001-04-26

Hi all.

Im kind of new to the UDP protocol.
Im setting up a client/server using UDPDuplex.

The server is set up as:

UDPDuplex server(server_address, server_port);
This will make it listen on the server_port right?

So a server.isInputReady(1000) would wait for incoming data, right?

When the client connects, it sends it's address and port. (Set up the same way as above).
So the server do a server.Receive(...);

The server connects to the client using

server.Connect(client_address, client_port);
And makes a server.Transmit(...);

At the same time the client do a
while(client.isInputReady(1000)) {
  client.Receive(...);
}

Later on when the "Connection phase" is done,
the client sends a ALIVE string to the server using client.Transmit(...);

and the server streams data to the client using server.Transmit(data).

My question is, is this the way to use the UDPDuplex?
Im getting a feeling that this is not quite right.
Could be a connection here or there to many or to litte.

There is two addresses and two ports defined here.
One for the constructor UDPDuplex(address, port).
That is for Receiving, right?

Another one for Connect(address, port) that is defining the target for sending, right?

Please help me.
Is there any examples using UDPDuplex somewhere?