Good day! I'm new to libiwip and I really need help!

Got a task - I have to make 2 applications with lwip library's raw (low-lvl)
interfases (not sockets) - a client and a server (both tcp). OS is desktop
Debian x64. I've compilled this lib.

1) Server must listen needed port and get messages from connections,
printing them on the screen.

2) Client Must connect to the servet and only send some message.

Server looks like this:

ncat -v -l -p 5555 -c 'while true; do read i && echo [echo] $i; done' (for
checking the 100% working client - if client will send something - I'll see
it in console)

And client looks like this:

lwip_init();
u8_t *state;
err_t err;
struct tcp_pcb *pcb;
struct ip_addr ipaddr;
IP4_ADDR(&ipaddr, 127,0,0,1);
if ((state = mem_malloc(1)) == NULL) {
 return ERR_MEM;
}

*state = 1;
if ((pcb = tcp_new()) == NULL)  {
   mem_free(state);
   return ERR_MEM;
}
tcp_arg(pcb, state);
tcp_err(pcb, hello_err);
tcp_recv(pcb, hello_recv);
tcp_sent(pcb, NULL);
tcp_poll(pcb, hello_poll_close, 10);
//
tcp_bind(pcb,&ipaddr, 5555);
//
err = tcp_connect(pcb, &ipaddr, 5555, hello_connected);
if (err != ERR_OK)  {
 std::cout << "err =  " << err << std::endl;
 std::cout << "err =  " << (int)err << std::endl;
 mem_free(state);
 tcp_abort(pcb);                

   }
Looking with Wireshark and there is silance.

Any ideas what am i doing wrong?

Thanks for helping, sorry for my English...



--
View this message in context: 
http://lwip.100.n7.nabble.com/Raw-TCP-client-server-tp22816.html
Sent from the lwip-users mailing list archive at Nabble.com.

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to