lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Raw TCP client - server


From: Pomeroy, Marty
Subject: Re: [lwip-users] Raw TCP client - server
Date: Mon, 23 Jun 2014 10:33:43 -0400

Your other message mentions 127.0.0.1, which is the loopback address.
Wireshark will not see packets on the loopback.  Is that what you are
trying to do?  It's not clear to me how to configure lwIP to support
loopback.

But if you are running on Debian, why not use the Debian IP stack?

 

-----Original Message-----
From: address@hidden
[mailto:address@hidden On
Behalf Of RedCollarPanda
Sent: Monday, June 23, 2014 3:36 AM
To: address@hidden
Subject: [lwip-users] Raw TCP client - server

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
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]