src/libYARP_OS/src/YARPSocketMulti.cpp
int _SocketThreadListMulti::closeByName (const YARPString& name)
{
	ACE_ASSERT (_initialized != 0);

	int result = YARP_FAIL;

	_listProtect.Wait();
	YARPList<_SocketThreadMultiBase *>::iterator it_avail(_list);

	for (; !it_avail.done(); it_avail++)
	{
		if (!((*it_avail)->isAvailable ()))
		{
			if (ACE_OS::strcmp((*it_avail)->getRemoteName().c_str(), name.c_str()) == 0)
			{
				(*it_avail)->End ();
				(*it_avail)->setAvailable (1);
				result = YARP_OK;
			}
		}
	}
	_listProtect.Post();

	return result;
}
// closes a particular connection identified by a symbolic name.
//	the YARPString is used as index into the list.
closes a particular connection identified by a symbolic name.
the YARPString is used as index into the list.
closes a particular connection identified by a symbolic name . the YARPString is used as index into the list .
int _SocketThreadListMulti::closeByName (const YARPString& name)
{
	ACE_ASSERT (_initialized != 0);
	int result = YARP_FAIL;
	_listProtect.Wait();
	YARPList<_SocketThreadMultiBase *>::iterator it_avail(_list);
	for (; !it_avail.done(); it_avail++)
	{
		if (!((*it_avail)->isAvailable ()))
		{
			if (ACE_OS::strcmp((*it_avail)->getRemoteName().c_str(), name.c_str()) == 0)
			{
				(*it_avail)->End ();
				(*it_avail)->setAvailable (1);
				result = YARP_OK;
			}
		}
	}
	_listProtect.Post();
	return result;
}
int _SocketThreadListMulti :: closeByName ( const YARPString & name ) { ACE_ASSERT ( _initialized != 0 ) ; int result = YARP_FAIL ; _listProtect . Wait ( ) ; YARPList < _SocketThreadMultiBase * > :: iterator it_avail ( _list ) ; for ( ; ! it_avail . done ( ) ; it_avail ++ ) { if ( ! ( ( * it_avail ) -> isAvailable ( ) ) ) { if ( ACE_OS :: strcmp ( ( * it_avail ) -> getRemoteName ( ) . c_str ( ) , name . c_str ( ) ) == 0 ) { ( * it_avail ) -> End ( ) ; ( * it_avail ) -> setAvailable ( 1 ) ; result = YARP_OK ; } } } _listProtect . Post ( ) ; return result ; }
closes a particular connection identified by a symbolic name.
closes a particular connection identified by a symbolic name .