|
From: | Teckinal Greek |
Subject: | [lwip-users] Cannot write to Server using lwIP |
Date: | Thu, 2 Sep 2010 12:44:11 +0000 |
Hi, I have successfully implemented Client-Server model using lwIP Raw API, I can connect to my Server which is my PC( a small server program is running so that i can use telnet command to get connected to it from normal PC and can write to it by typing from the key board). In the same way I have made my FPGA to work as client. With my code I can connect it to the server, which i can see on the server side that my client is connected. Now my problem is that I could not write to the server. Here is the piece of code which does the job of writing to the server...... static err_t client_connected(void *arg, struct tcp_pcb *tpcb, err_t err) { char string[] = "Hello!"; LWIP_UNUSED_ARG(arg); err_t ret_val; if(err != ERR_OK) printf("\n client connected(): err argument not set to ERR_OK, but the value is %d\n", err); else { tcp_sent(tpcb, client_sent); printf("Sucess\n"); ret_val = tcp_write(tpcb, &string, sizeof(string), 1); printf("ret_val = %d", ret_val); tcp_output(tpcb); } return err; } I am getting the value of ret_val = 0. But the problem is that I could not print the string "Hello!" to the server. Where am I making my mistake. Regards, TG
|
[Prev in Thread] | Current Thread | [Next in Thread] |