lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Data sending problem over TCP


From: Kieran Mansley
Subject: Re: [lwip-users] Data sending problem over TCP
Date: Thu, 23 Jun 2011 14:18:25 +0100

On Thu, 2011-06-23 at 15:10 +0530, Sanchayan wrote:
> 
> I have attached the wireshark .pcap file. And also a screenshot of 
> wireshark.

That shows that the connection is being rejected by the host you're
trying to connect to, probably because there is nothing listening on
that port number.

This should result in the tcp_err() callback being triggered to notify
you that the connection has failed.  If it had succeeded the connected
callback that you can pass to tcp_connect() would be called, but I
notice that you're just giving it NULL instead.  If you take a look in
doc/rawapi.txt there's a section there on how to use tcp_connect():

- err_t tcp_connect(struct tcp_pcb *pcb, struct ip_addr *ipaddr,
                    u16_t port, err_t (* connected)(void *arg,
                                                    struct tcp_pcb
*tpcb,
                                                    err_t err));

  Sets up the pcb to connect to the remote host and sends the
  initial SYN segment which opens the connection. 

  The tcp_connect() function returns immediately; it does not wait for
  the connection to be properly setup. Instead, it will call the
  function specified as the fourth argument (the "connected" argument)
  when the connection is established. If the connection could not be
  properly established, either because the other host refused the
  connection or because the other host didn't answer, the "err"
  callback function of this pcb (registered with tcp_err, see below)
  will be called.

  The tcp_connect() function can return ERR_MEM if no memory is
  available for enqueueing the SYN segment. If the SYN indeed was
  enqueued successfully, the tcp_connect() function returns ERR_OK.

Kieran




reply via email to

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