rt_acceptor_filters.cpp

来自「这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用」· C++ 代码 · 共 68 行

CPP
68
字号
// @(#) RT_Acceptor_Filters.cpp,v 1.6 2003/06/20 04:25:13 dhinton Exp

#include "RT_Acceptor_Filters.h"

#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0

#include "tao/Transport_Acceptor.h"
#include "tao/MProfile.h"
#include "tao/Profile.h"

#if ! defined (__ACE_INLINE__)
#include "RT_Acceptor_Filters.i"
#endif /* __ACE_INLINE__ */

ACE_RCSID (tao,
           RT_Acceptor_Filter,
           "RT_Acceptor_Filters.cpp,v 1.6 2003/06/20 04:25:13 dhinton Exp")

TAO_Server_Protocol_Acceptor_Filter::
TAO_Server_Protocol_Acceptor_Filter (RTCORBA::ProtocolList &protocols)
  : protocols_ (protocols)
{
}

int
TAO_Server_Protocol_Acceptor_Filter::fill_profile (const TAO::ObjectKey &object_key,
                                                   TAO_MProfile &mprofile,
                                                   TAO_Acceptor **acceptors_begin,
                                                   TAO_Acceptor **acceptors_end,
                                                   CORBA::Short priority)
{
  // RTCORBA 1.0, Section 4.15.1: ServerProtocolPolicy determines
  // which protocols get included into IOR and in what order.
  for (CORBA::ULong j = 0; j < this->protocols_.length (); ++j)
    {
      CORBA::ULong protocol_type = this->protocols_[j].protocol_type;

      for (TAO_Acceptor** acceptor = acceptors_begin;
           acceptor != acceptors_end;
           ++acceptor)
        if ((*acceptor)->tag () == protocol_type &&
            ((*acceptor)->create_profile (object_key,
                                          mprofile,
                                          priority) == -1))
          return -1;
    }

  return 0;
}

int
TAO_Server_Protocol_Acceptor_Filter::encode_endpoints (TAO_MProfile &mprofile)
{
  // Encode endpoints.
  for (CORBA::ULong i = 0;
       i < mprofile.profile_count ();
       ++i)
    {
      TAO_Profile *profile = mprofile.get_profile (i);
      if (profile->encode_endpoints () == -1)
        return -1;
    }

  return 0;
}

#endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?