src/libYARP_OS/src/YARPSocketMulti.cpp
int _SocketThreadListMulti::receiveMore(ACE_HANDLE reply_pid, char *buf, int len)
{
	int result = YARP_FAIL;

	ACE_ASSERT (_initialized != 0);

	_listProtect.Wait();
	YARPList<_SocketThreadMultiBase *>::iterator it_avail(_list);
	for (; !it_avail.done(); it_avail++)
	{
		if (!((*it_avail)->isAvailable()))
		{
			if ((*it_avail)->getID() == reply_pid)
			{
				(*it_avail)->waitOnMutex ();
				(*it_avail)->setExternalReplyBuffer (buf);
				(*it_avail)->setExternalReplyLength (len);
				(*it_avail)->setReadMore (1);
				(*it_avail)->postToWakeup ();
				(*it_avail)->postToMutex ();
				(*it_avail)->waitOnReplyMade ();
				result = (*it_avail)->getExternalReplyLength ();
			}
		}
	}
	_listProtect.Post();

	return result;
}
// this demands exact number of bytes
this demands exact number of bytes
this demands exact number of bytes
int _SocketThreadListMulti::receiveMore(ACE_HANDLE reply_pid, char *buf, int len)
{
	int result = YARP_FAIL;
	ACE_ASSERT (_initialized != 0);
	_listProtect.Wait();
	YARPList<_SocketThreadMultiBase *>::iterator it_avail(_list);
	for (; !it_avail.done(); it_avail++)
	{
		if (!((*it_avail)->isAvailable()))
		{
			if ((*it_avail)->getID() == reply_pid)
			{
				(*it_avail)->waitOnMutex ();
				(*it_avail)->setExternalReplyBuffer (buf);
				(*it_avail)->setExternalReplyLength (len);
				(*it_avail)->setReadMore (1);
				(*it_avail)->postToWakeup ();
				(*it_avail)->postToMutex ();
				(*it_avail)->waitOnReplyMade ();
				result = (*it_avail)->getExternalReplyLength ();
			}
		}
	}
	_listProtect.Post();
	return result;
}
int _SocketThreadListMulti :: receiveMore ( ACE_HANDLE reply_pid , char * buf , int len ) { int result = YARP_FAIL ; ACE_ASSERT ( _initialized != 0 ) ; _listProtect . Wait ( ) ; YARPList < _SocketThreadMultiBase * > :: iterator it_avail ( _list ) ; for ( ; ! it_avail . done ( ) ; it_avail ++ ) { if ( ! ( ( * it_avail ) -> isAvailable ( ) ) ) { if ( ( * it_avail ) -> getID ( ) == reply_pid ) { ( * it_avail ) -> waitOnMutex ( ) ; ( * it_avail ) -> setExternalReplyBuffer ( buf ) ; ( * it_avail ) -> setExternalReplyLength ( len ) ; ( * it_avail ) -> setReadMore ( 1 ) ; ( * it_avail ) -> postToWakeup ( ) ; ( * it_avail ) -> postToMutex ( ) ; ( * it_avail ) -> waitOnReplyMade ( ) ; result = ( * it_avail ) -> getExternalReplyLength ( ) ; } } } _listProtect . Post ( ) ; return result ; }
this demands exact number of bytes
this demands exact number of bytes