# Wip\_copt\_keepalive

**URL:** <https://forum.sierrawireless.com/t/wip-copt-keepalive/2746>\
**Category:** Open AT\
**Created:** [December 15, 2008, 9:48am UTC](https://forum.sierrawireless.com/t/wip-copt-keepalive/2746 "2008-12-15T09:48:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [December 15, 2008, 9:48am UTC](https://forum.sierrawireless.com/t/wip-copt-keepalive/2746/1 "2008-12-15T09:48:15Z")

</div>

hi all,  
i want to use keepalive option to send ping on a period. but i think it should be used with a tcp client channel which keeps the server address and port to be pinged . so there will be always a live client channel that sends pings to the server like [google.com](http://google.com)? or is there any way to send pings with a specified time period?

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [December 15, 2008, 10:39am UTC](https://forum.sierrawireless.com/t/wip-copt-keepalive/2746/2 "2008-12-15T10:39:51Z")

</div>

Hiya,

Start the ping operation from a timer that fires at the desired interval. If the ping returns appropriately, restart the timer. If the ping times out, you’ve been disconnected from the network and have to take care of re-connection before restarting the timer.

Works well for me.

Note that you can use a lot of data if your timer is very frequent.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [December 15, 2008, 3:37pm UTC](https://forum.sierrawireless.com/t/wip-copt-keepalive/2746/3 "2008-12-15T15:37:56Z")

</div>

i start using wip\_pingCreateOpts function to create ping requests. But there is not much information about this operation on the documents. So i m asking how i can make a periodic ping requests with this function. i want to ping [google.com](http://google.com) every hour. then i tried following code

wip\_pingCreateOpts(“[www.google.com](http://www.google.com)”,EventHandler\_pingChannel,NULL,WIP\_COPT\_REPEAT,5, WIP\_COPT\_INTERVAL, 36000, WIP\_COPT\_END);

with this code, i wait that will send ping request five(5) times every hour(36000 ms). Then i follow EventHandler\_pingChannel function. I get WIP\_CEV\_OPEN code for the first time. but then i can not get any message after 1 hour or later. shouldnt i get WIP\_CEV\_PING message after 1 hour? doesnt this code send pings to google with the interval of 36000 ms, 5 times?

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [December 15, 2008, 4:43pm UTC](https://forum.sierrawireless.com/t/wip-copt-keepalive/2746/4 "2008-12-15T16:43:18Z")

</div>

> [@zafer](#):
>
> But there is not much information about this operation on the documents.

Isn’t there?

you haven’t said waht version you’re using, but for v4.00 it clearly says that WIP\_COPT\_REPEAT is the number of PING echo requests, and WIP\_COPT\_INTERVAL is the time between two PING echo requests in ms; so

> [@](#):
>
> wip\_pingCreateOpts( “[www.google.com](http://www.google.com)”, EventHandler\_pingChannel, NULL,  
> WIP\_COPT\_REPEAT,5,  
> WIP\_COPT\_INTERVAL, 36000,  
> WIP\_COPT\_END );

Will send 5 PING echo requests, with an interval of 36000ms between each request.

This is exactly the same way that PING works from the Windows command line

---

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [December 16, 2008, 6:23am UTC](https://forum.sierrawireless.com/t/wip-copt-keepalive/2746/5 "2008-12-16T06:23:36Z")

</div>

> [@awneil](#):
>
> it clearly says that WIP\_COPT\_REPEAT is the number of PING echo requests, and WIP\_COPT\_INTERVAL is the time between two PING echo requests in ms

yes it says this but this is not enough for me. there isnt any line of codes even. And i see on my logs that it pings 5 echo request at the same time, not with the interval i supplied. it is like  
WIP\_CEV\_OPEN 11:00:00 (this is time)  
WIP\_CEV\_PING 11:00:01  
WIP\_CEV\_PING 11:00:01  
WIP\_CEV\_PING 11:00:01  
WIP\_CEV\_PING 11:00:01  
WIP\_CEV\_PING 11:00:01  
WIP\_CEV\_PEER\_CLOSE 11:00:01

And sometimes only;  
WIP\_CEV\_OPEN

so i decided to use timer to send ping requests, i will check timeout by myself. i hope it would work.
