Re: UDP Client Problem
- From: Muhammad Azeem Azam <MuhammadAzeemAzam@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 21 Feb 2007 00:50:11 -0800
hi
I know the port of my server an i am sending data successfully.
But my microcontroller (server using some other library to send and
receive), microcontroller wants to know the port an ip of remote host (means
client), this means i have to bind my client (in UDP) so that microcontroller
can send data to client.
Actually i am sending request from client (PC) to Server (Microcontroller)
and in return micocontroller is sending the required data to me.
Thanks for help in advance.
Bye
"Arkady Frenkel" wrote:
No, client have to know server's port and send to data to it, OTOH server.
can check that when recvfrom() returned successfully
Arkady
"Muhammad Azeem Azam" <MuhammadAzeemAzam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:0DEFA80C-16D3-49EC-8DDC-014C83E61039@xxxxxxxxxxxxxxxx
Hi
the problem is my server need to know the port of my client (that shold be
permanant?)
How can i know my port(getsockname() ?).
But i think i need to fix my port.
thanks
"Arkady Frenkel" wrote:
No, you don't need to bind client client both in UDP and TCP
Arkady
"Muhammad Azeem Azam" <MuhammadAzeemAzam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
in
message news:CBB58DCB-5207-40AF-9740-8516FCB68223@xxxxxxxxxxxxxxxx
Hi
I have to made a UDP client.
Do i ned to bind it or not.
My Server has following function for dending data to client
----------------------------
int NutUdpReceiveFrom ( UDPSOCKET * sock,
u_long * addr,
u_short * port,
void * data,
u_short size,
u_long timeout
)
Receive a UDP datagram.
Parameters:
sock Socket descriptor. This pointer must have been retrieved by
calling
NutUdpCreateSocket().
addr - IP address of the remote host in network byte order.
port - Remote port number in host byte order.
data - Pointer to the buffer that receives the data.
size - Size of the buffer that receives the data.
timeout - Maximum number of milliseconds to wait.
-------------------
But problem is its asking for the remote host IP Address and Port.
This menas i have to bind my client to specific port.
Am i right?
Thanks for help in advance
BYe
- Follow-Ups:
- Re: UDP Client Problem
- From: Arkady Frenkel
- Re: UDP Client Problem
- References:
- Re: UDP Client Problem
- From: Arkady Frenkel
- Re: UDP Client Problem
- From: Arkady Frenkel
- Re: UDP Client Problem
- Prev by Date: Re: Wireless in c++
- Next by Date: Require Info on EAP extension development for windows mobile
- Previous by thread: Re: UDP Client Problem
- Next by thread: Re: UDP Client Problem
- Index(es):
Relevant Pages
|
Loading