I am using Dev studio open at application. I am beginner to this tool. In this i tried the sample code given for TCP client. By using this code i can able to communicate with my server in the opened socket. Also i tried to send packets at periodic intervals by using timer function. For this i developed code below
In your code you are creating a new TCP client every 15 seconds. The internet plugin can only support 15 concurrent TCP clients, which is why you are failing to connect. You have two options to resolve this:
Open the TCP client, send the data, close the TCP client, repeat every 15 seconds, or
Open the TCP client, send data every 15 seconds, close the client.
I’d recommend option 2. So, when you start your application and have a GSM network connection and have started your GPRS bearer, create the TCP client and store the handle. Then, in your 15 seconds timer, call wip_write with the TCP client handle and the data you want to send. See the picture below from the WIP Development Guide.
for this time also received error ad “[SAMPLE] write Error -999”
can anyone explain me why this error occurs?
From the error value i guess socket is not opened is it wright?
i have doubt in passing arguments to function packetsend?
is there anyother way available to send packets at periodic intervals?
if avail means send me that.
i have tried the code which you given in the last reply,
but for that i got the following errors .\src\entry_point.c:255: error: invalid storage class for function ‘timerCallback’
…\src\entry_point.c:265: error: expected declaration or statement at end of input
If the server closes the connection and you get WIP_CEV_PEER_CLOSE, or if some other error occurs, shutdown the client connection using
and reopen it using
If there is some other GPRS or GSM related error, you may also have to close down your GPRS connection and restart that too. Alternatively, the other solution is to just reset your entire modem and start from scratch.