Thank you very much
I have installed the M2M studio application and started playing with the TCP server sockets, and they seem to work fine over GPRS.
Have not touched the serial part yet.
First things first, im getting the tcp server part ready before im going to touch the serial side of things.
However i have run into a few issues…
To begin with, im creating a connection handler which can handle 1 or more connections, all new
connections are stored in
static wip_channel_t *ActiveChannels[8];
the new connections are added by:
static void evh( wip_event_t *ev, void *ctx) {
static int clients_count = 0;
switch( ev->kind)
{
case WIP_CEV_OPEN:
{
clients_count++;
wip_debug ( "[SAMPLE] New client connection 0x%x. "
"There are now %i clients connected.\n",
ev->channel, clients_count);
int OpenChannel = GetChannelSlot();
if(OpenChannel>-1)
{
ActiveChannels[OpenChannel] = ev->channel;
}
GetChannelSlot();
break;
}
And then i try to see if a connection is dead by using a timer and
for(i = 0; i < 8; i++)
{
if(ActiveChannels[i] != NULL)
{
wip_debug ("channel=%d state=%d\r\n",i, wip_getState(ActiveChannels[i]));
}
}
The state doesnt change when i drop the tcp IP connection, so is there any other way to determine if a client has dropped a connection to the tcp server?
I basically want to make sure the clients are all still connected, when i get to the serial part i want to broadcast all serial data to active clients in my ActiveChannels[] list
Dead clients are to be removed from the list, once i find a way to spot them.
Regards
Johan