anyKode Marilou
ContentsIndexHome
PreviousUpNext
Connection::Connection

Connection class constructor.

C++
Connection(bool bEnableConnectionConsoleMessages, int TCPChannelsCount = DefaultModaTCPChannels);
Parameters 
Description 
bool bEnableConnectionConsoleMessages 
[in] Enable/disable consoles messages. 
int TCPChannelsCount = DefaultModaTCPChannels 
[in] TCP channels count : the minimum value is 3. (this parameter is optional) 

A Connection object opens several TCP channels for dialing with MODA server. A robotics application can talk with the server with several threads, in parallel. Every device call gets a free TCP channel for dialing then free it when the call returns. The minimum channels count is 3. A robotics application that uses more than 3 threads can open more channels by specifying the required count when creating a Connection object (TCPChannelsCount). 

 

When no more channel is available for a device call, the caller is awaiting for a free channel during 50 ms. After this time, and if no channel is available, the call returns with the system error MODA_ETCPCHANNELSBUSY (-4). 

 

A thread dial with Moda server by locking a channel during the time required for sending/receiving data. Some commands like Camera images retrieval, 'xxxWaitComplete' sensor functions or Sleep/Wait functions can lock the channel during a long time. If your application is using a lot of threads, you should increase the number of Connection's TCP channels.

Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
What do you think about this topic? Send feedback!