No TCP connection

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

No TCP connection

Amir Bukhari-2
I have initialized TCP and IP and setup a small HTTP server, but I didn't
got any connection from others computers. For example when I connect to it
from explorer I got an error indicating that no connection to host
available. Note that I can PING my host.

After I initialized my network, I create a thread

------------------------------------
static void
main_thread(void *arg)
{
        struct tcp_pcb *pcb;
  sys_sem_t sem;
  /*netif_set_default(netif_add(&ipaddr, &netmask, &gw, NULL,
sioslipif_init1,
                              tcpip_input)); */

 
  sem = sys_sem_new(0);
  tcpip_init(tcpip_init_done, &sem);
  sys_sem_wait(sem);
  sys_sem_free(sem);
  printf("TCP/IP initialized.\n");

  printf("Applications started.\n");
 
  /* Create a new TCP PCB. */
        pcb = tcp_new();
        /* Bind the PCB to TCP port 80. */
        tcp_bind(pcb, IP_ADDR_ANY, 80);
        /* Change TCP state to LISTEN. */
        pcb = tcp_listen(pcb);
        /* Set up http_accet() function to be called
        when a new connection arrives. */
        tcp_accept(pcb, http_accept);
   
  sys_timeout(5000, tcp_timeout, NULL);


  sem = sys_sem_new(0);
  sys_sem_wait(sem);
 
}
-------------------------

but my http_accept function never got called.

Thanks,
-Amir


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: No TCP connection

Christiaan Simons

lwip-users-bounces+christiaan.simons=[hidden email] wrote on 07-11-2005
11:36:55:

> I have initialized TCP and IP and setup a small HTTP server, but I didn't
> got any connection from others computers. For example when I connect to
it
> from explorer I got an error indicating that no connection to host
> available. Note that I can PING my host.
>

This looks like you're mixing up the APIs.

The semaphore stuff implies the sequential/socket API where
you have e.g. netconn_new(NETCONN_TCP).

I'm unsure if this can be of any harm, maybe not.
I wouldn't dare to mix them. This is also one of
the current problems with the unixsim example.

The same sort of mixing happens there,
and this is very confusing to new users.

I'll have a look if the sequential API is
documented clearly enough.


Christiaan Simons

Hardware / Software Engineer
Axon Digital Design

+31 (0)13 511 66 66
+31 (0)13 511 41 51

http://www.axon.tv




This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named.  If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

RE: No TCP connection

Amir Bukhari-2
In reply to this post by Amir Bukhari-2

I have test also with the following:

void lwip_init(void)
{
#ifdef STATS
        stats_init();
#endif
        sys_init();
        mem_init();
        memp_init();
        pbuf_init();
        etharp_init();
       
        ip_init();
        udp_init();
        tcp_init();
       
}

void net_init(void)
{
        struct netif *netif_eth;
        uint8 *addr;
       
        IP4_ADDR(&eth_gw, 141,21,4,1);
  IP4_ADDR(&eth_ip, 141,21,7,245);
  IP4_ADDR(&eth_netmask, 255,255,252,0);
   
        netif_eth = netif_add(&netif_eth0, &eth_ip, &eth_netmask, &eth_gw,
                  NULL, mpc5200_init, ip_input);
    netif_set_default(netif_eth);

        netif_set_up(netif_eth);
               
}

I call lwip_init first and then net_init and also doesn't got any
connection, but as I said I can pinging, that mean IP layer works.


-----Original Message-----
From: lwip-users-bounces+bukhari=[hidden email]
[mailto:lwip-users-bounces+bukhari=[hidden email]] On Behalf Of
Christiaan Simons
Sent: Monday, November 07, 2005 1:18 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] No TCP connection


lwip-users-bounces+christiaan.simons=[hidden email] wrote on
lwip-users-bounces+07-11-2005
11:36:55:

> I have initialized TCP and IP and setup a small HTTP server, but I
> didn't got any connection from others computers. For example when I
> connect to
it
> from explorer I got an error indicating that no connection to host
> available. Note that I can PING my host.
>

This looks like you're mixing up the APIs.

The semaphore stuff implies the sequential/socket API where you have e.g.
netconn_new(NETCONN_TCP).

I'm unsure if this can be of any harm, maybe not.
I wouldn't dare to mix them. This is also one of the current problems with
the unixsim example.

The same sort of mixing happens there,
and this is very confusing to new users.

I'll have a look if the sequential API is documented clearly enough.


Christiaan Simons

Hardware / Software Engineer
Axon Digital Design

+31 (0)13 511 66 66
+31 (0)13 511 41 51

http://www.axon.tv




This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named.  If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.



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


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