struct ip_addr server_ip;
struct ip_addr client_ip;
...
void HelloWorld_init(void)
{
IP4_ADDR(&server_ip,192,168,0,6);
IP4_ADDR(&client_ip,192,168,0,33);
struct tcp_pcb *pcb;
/* Create a new TCP control block */
pcb = tcp_new();
/* Assign to the new pcb a local IP address and a port number */
/* Using IP_ADDR_ANY allow the pcb to be used by any local interface */
tcp_bind(pcb, &client_ip, 80);
//tcp_connect(pcb, &server_ip, 80, tcp_client_connected_l);
//int i;
//for(i=0;i<2000;i++);
//tcp_write(pcb, HELLO, strlen(HELLO), 1);
/* Set the connection to the LISTEN state */
//pcb = tcp_listen(pcb);
/* Specify the function to be called when a connection is established */
tcp_accept(pcb, HelloWorld_accept);
tcp_connect(pcb, &server_ip, 80, tcp_client_connected_l);
tcp_write(pcb, HELLO, strlen(HELLO), 1);
}