Hi ,
i have a LPC2378 server working
i can receive a message and print it to the hyper terminal .
but i also want after i receive the message to send it to someone else…
for that i wrote the following code .
if anyone can give me any help on this issue - will be very grateful .
btw , i checked the server side - and he is working fine .
/* the following code is excuted when i receive a message over tcp */
PSOCK_BEGIN(&s->sin);
PSOCK_READTO(&s->sin,‘\n’);
printf(“\r\n”);
printf(s->inputbuf); // this is the point i print to terminal the received msg
printf(“\r\ncreating conn”);
u16_t ipaddr[2];
uip_ipaddr(ipaddr, 192,168,1,103);
uip_connect(ipaddr, HTONS(3000));
if (uip_connected()){
uip_send(“ok\n”, 3); // this is not excuted - connection is established .
printf(“\r\nsent the OK\n”);
}
PSOCK_CLOSE(&s->sin);
PSOCK_END(&s->sin);
PSOCK_EXIT(&s->sin);