[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] tcp_connection (no SYN packet on server side)
From: |
inderjit |
Subject: |
[lwip-users] tcp_connection (no SYN packet on server side) |
Date: |
Fri, 1 Jun 2018 04:17:47 -0700 (MST) |
Hi,
I'm new to LWIP and trying to get tcp/ip protocol working with static ip.
I have SAM4E based MCU that is to be worked as client and I'm just mocking a server on raspberry pi (no implementation so far, only monitoring using tcpdump and iptables. The devices are connected by ethernet cable RJ45.
My current setting is:
#define NO_SYS 1
#define LWIP_NETIF_STATUS_CALLBACK 1
//#define DHCP_USED
#define MEMP_NUM_TCP_PCB 2
#define MEMP_NUM_TCP_PCB_LISTEN 1
#define LWIP_TCP 1
The following code goes without any problems:
ip_addr_t ip;
uint32_t data = ""
pcb_tcp = tcp_new();
/* register callbacks */
tcp_err(pcb_tcp , tcp_err_cb);
tcp_recv(pcb_tcp , tcp_recv_cb);
tcp_sent(pcb_tcp , tcp_sent_cb);
tcp_arg(pcb_tcp, (void*) &data);
/* bind to address and port */
IP4_ADDR(&ip, 192, 168, 100, 250);
tcp_bind(pcb_tcp, &ip, 8080);
IP4_ADDR(&ip, 192, 168, 100,155);
err = tcp_connect(pcb_tcp, &ip, 8080, tcp_connected_cb);
if (err != 0) {
LWIP_ASSERT("err != 0", 0);
}
On my server side (raspberry pi I'm monitoring all packages received by tcpdump and iptables.
After a while I get a timeout and consequently ERR_ABRT
on callback which is OK. BUT I am not seeing any packages i.e no SYN packets being received on server side although on client it says: pcb_tcp->state =SYN_SENT
Should I not? Am I missing something?
Thanks in advance.
Indy
Sent from the lwip-users mailing list archive at Nabble.com.
- [lwip-users] tcp_connection (no SYN packet on server side),
inderjit <=