[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] UDP with different clients
From: |
Urs Gerber |
Subject: |
[lwip-users] UDP with different clients |
Date: |
Fri, 27 Aug 2004 11:49:53 +0200 |
Hi,
I try to connect udp with any remotadress and I can receive the message from
the client.
Now, if I give a answer to this message, I connect the client with the
received adress and port and
send the answer.
This part work only for two times and after there, I will not received any
message!
What I have to do, that its work all the time?
My code is:
conn = netconn_new(NETCONN_UDP); /* Create a new UDP connection
handle. */
netconn_bind(conn, NULL, 7000);
netconn_listen(conn); /* Put the connection into
LISTEN state. */
/* Loop forever. */
while(1) {
buf = netconn_recv(conn); /* receive data form the other
host */
if (buf != NULL) {
netconn_connect(conn,buf->fromaddr,buf->fromport); /* Connect
the connection to the remote host */
netbuf_data(buf, (void **)&rq, &len); /* Get the data from netbuf */
netbuf_delete(buf); /* delete data buffer */
buf = netbuf_new(); /* Buffer allozieren */
netbuf_ref(buf,File,usTotalLen);
netconn_send(conn,buf);
}
}
regards,
Urs
- [lwip-users] UDP with different clients,
Urs Gerber <=