[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] [lwip] tcp_connect
From: |
natalia varillas |
Subject: |
[lwip-users] [lwip] tcp_connect |
Date: |
Thu, 09 Jan 2003 00:58:05 -0000 |
Hello,
I want to create a new connection between the board IP: 192,168,1,2 and
a server listening in 192,168,1,3 port 4443
This code down here dont work.It seems that never call the
write_asnwer_to server function.
if i want to create a new connection i call tcp_connect. but Which value
has to have last arg in the function if its a NEW connection??
static err_t write_answer_to_server(void *arg, struct tcp_pcb *tpcb,
err_t err)
{
char buf[100];
err_t new_err;
sprintf(buf, "%s\n","Test");
new_err=tcp_write(tpcb,(void *)buf,sizeof(buf)-1,0);
return new_err;
}
void send_answer_to_server(char *str) {
struct tcp_pcb *pcb;
struct ip_addr ipaddr;
err_t new_err;
IP4_ADDR(&ipaddr,192,168,1 ,3);
pcb = tcp_pcb_new();
new_err = tcp_connect(pcb, &ipaddr, SERVER_TO_SEND_ANSWERS_PORT,
write_answer_to_server, NETCONN_TCP);
DEBUGF_RTXC(RTXC_APPS_DEBUG, ("Connect error?=%d\n", new_err));
Natalia
[This message was sent through the lwip discussion list.]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-users] [lwip] tcp_connect,
natalia varillas <=