I get an error " sim_player: client.c:162: playerc_client_create: Assertion `client->read_xdrdata' failed. " when I try to clients for a pioneer robot

My program is organized like this

in the main function I use the following commands first to create client

        PlayerClient pioneer (gHostname, gPort);      
        Position2dProxy pp (&pioneer, gIndex);
        LaserProxy lp (&pioneer, gIndex);

The stage reports "accepted TCP client 0 on port 6665, fd 11"

In the main function I use laser data and position data to find out the way points for my robot. I send these way points as an array to a new thread where

I use the commands
       
         PlayerClient pioneer (gHostname, gPort);      
        Position2dProxy pp (&pioneer, gIndex);
      
 
again to  obtain client proxies to find out the current position of  the robot.

The stage reports "accepted TCP client 1 on port 6665, fd 12"

When I obtain new set of way points I close the thread and start a new one and then the stage reports that "accepted TCP client 2 on port 6665, fd 12" and this process continues.

But, the my program exits with the error "sim_player: client.c:162: playerc_client_create: Assertion `client->read_xdrdata' failed."

and i have observed that the stage gives out the message "accepted TCP client 35 on port 6665, fd 12" and disconnects all the previous connections.

I have a feeling that the there is a hard limit on maximum number of clients is 35.

Is there a way to fix this issue?

I am using Player 2.1.3 and stage 2.1 and c++ libraries


--
Srinivas Tennety
Graduate Student
University of Cincinnati