Hello,
i have one more problem. My goal is:
- connect to server
loop
- send request (get request like
/my_php?dataFrom=[something]&dataTo=[something])
- and wait for response
while(some termination)
I did this (code below), but a second request is never sent to server.
First request id OK, i get the data in processes it ok. But at the
second request, netconn_write it seems it never send it to a server
anything (i watch with WireShark).
I tried to connect/disconnect, close - connect, but nothing worked.
So if please can anybody tell the correct procedure to send/recieve
data TCP connection.
Thanks to anybody who will even read it.
Dan
resultCon = netconn_connect(xNetConn, &remote_ip,
cdata->host_port_number );
downloadBlock:
xNetConn->recv_timeout = 30000;
sprintf(request_my_c, "GET /my_php/data.php?startB=%d&lenB=%d
HTTP/1.1\r\nAccept: */*\r\nAccept-Language: sl\r\nUser-Agent:
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\r\nHost:
%d.%d.%d.%d:%d\r\nConnection: Close\r\n\r\n\0",
transData,transDataLen,cdata->host_add[0],cdata->host_add[1],cdata->host_add[2],cdata->host_add[3]
, cdata->host_port_number);
netconn_write(xNetConn, request_my_c, strlen(request_my_c),
NETCONN_COPY);
while (1)
{
resultRecv = netconn_recv(xNetConn, &buf);
//process data
//all blocks downloaded -> break
//goto another block;
}
some code....