lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] tcp_connect problem


From: eko cahyono
Subject: [lwip-users] tcp_connect problem
Date: Sun, 15 Mar 2009 20:00:03 -0800

Hello i am a new user of lwIP. I am using lwIP-1.2 and porting to AVR ATMega64. Everything is works well when i compiled the example (http server). But when I am starting to make a clien application using lwIP a problem occured. I can not connect the server but when I checked the response everything is fine (tcp_new,tcp_bind,tcp_connect) . I also have checked using Ethereal but there is no data to be sent and tes function is never been called. here is my source code. is there I miss somethong or something wrong in my code ?


err_t tes(void *arg, struct tcp_pcb *newpcb, err_t err)
{
    puts("OK\r\n");
}

void ClientInit(void)
{
    struct tcp_pcb* tcp_pcb_connect;
   
    IP4_ADDR(&server_ipaddr_data,  192, 168, 0, 1);
    tcp_pcb_connect = tcp_new();
    if (tcp_pcb_connect!=NULL)
    {
        if (tcp_bind(tcp_pcb_connect, IP_ADDR_ANY, 7500)==ERR_OK)
        {
            if (tcp_connect(tcp_pcb_connect, &server_ipaddr_data, 7500, tes)==ERR_OK)
                puts("CONNECT\r\n");
            else puts("CAN'T CONNECT\r\n");
        }
        else puts("CAN'T BIND\r\n");
    }
    else puts("CAN'T ALLOCATE\r\n");
}

thank you for your information.
reply via email to

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