[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE : [lwip-users] netconn_connct returning always ERR_OK
From: |
Frédéric BERNON |
Subject: |
RE : [lwip-users] netconn_connct returning always ERR_OK |
Date: |
Tue, 15 Jan 2008 13:54:42 +0100 |
Which lwIP release do you use ?
====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : address@hidden
Web Site : http://www.hymatom.fr
====================================
P Avant d'imprimer, penser à l'environnement
-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Marko Panger
Envoyé : mardi 15 janvier 2008 13:12
À : Mailing list for lwIP users
Objet : [lwip-users] netconn_connct returning always ERR_OK
Hi all,
I'm writing a client app. which connects to a remote server. I'm running
lwip under an rtos with
#define NO_SYS 0
I'm using the netconn sequential api and there is something about the
netconn_connect() call which is confusing me.
If I try to connect to a non-existing server (nobody is listening on
that ip on that port) the call still returns with ERR_OK.
Shouldn't be some other error code ?
In general how do I know that the other side has received the data send
by the client with netconn_write() ?
Please find attached the code snipped below for reference.
Thanks in advance for your help and comments,
marko
IP4_ADDR(&local_ip, 192, 168, 3, 2);
IP4_ADDR(&net_mask, 255, 255, 255, 0);
IP4_ADDR(&gateway, 192, 168, 3, 1);
IP4_ADDR(&server_ip, 192, 168, 3, 1);
netif_add(&slip_if, &local_ip, &net_mask, &gateway, NULL,
slipif_init, tcpip_input);
netif_set_default(&slip_if);
netif_set_up(&slip_if);
/* Connect to server */
conn = netconn_new_with_proto_and_callback(NETCONN_TCP, 6,
server_conn_clb);
while(netconn_connect(conn, &server_ip, RVA_PORT) != ERR_OK)
TSK_Sleep(100);
while(1) {
while(!(buf = netconn_recv(conn)))
TSK_Sleep(10);
netbuf_data(buf, (void*)&p, &len);
payload_len = *p++;
/* Ping */
switch(*p) {
case 6:
netconn_write(conn, p-1, len, true);
netbuf_delete(buf);
break;
}
}
_______________________________________________
lwip-users mailing list
address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users
Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf
- RE : [lwip-users] netconn_connct returning always ERR_OK,
Frédéric BERNON <=
- RE: RE : [lwip-users] netconn_connct returning always ERR_OK, Marko Panger, 2008/01/21
- Re: RE : [lwip-users] netconn_connct returning always ERR_OK, Jonathan Larmour, 2008/01/21
- Re: RE : [lwip-users] netconn_connct returning always ERR_OK, Marko Panger, 2008/01/21
- RE : [lwip-users] netconn_connct returning always ERR_OK, address@hidden, 2008/01/21
- Re: RE : [lwip-users] netconn_connct returning always ERR_OK, Marko Panger, 2008/01/21
- RE : [lwip-users] netconn_connct returning always ERR_OK, Goldschmidt Simon, 2008/01/22
- Re: RE : [lwip-users] netconn_connct returning always ERR_OK, Marko Panger, 2008/01/22