Esempio n. 1
0
int
FillQoSParams (ACE_QoS_Params &qos_params,
               iovec* iov,
               ACE_QoS* qos)
{
  qos_params.callee_data (iov);
  qos_params.caller_data (0);
  qos_params.socket_qos (qos);
  qos_params.group_socket_qos (0);
  qos_params.flags (ACE_JL_BOTH);

  return 0;
}
Esempio n. 2
0
TAO_BEGIN_VERSIONED_NAMESPACE_DECL

int
FillQoSParams (ACE_QoS_Params &qos_params,
               iovec* iov,
               ACE_QoS* qos)
{
    qos_params.callee_data (iov);
    qos_params.caller_data (0);
    qos_params.socket_qos (qos);
    qos_params.group_socket_qos (0);
    qos_params.flags (ACE_JL_BOTH);

    return 0;
}
Esempio n. 3
0
int
ACE_SOCK_Dgram_Mcast_QoS::subscribe (const ACE_INET_Addr &mcast_addr,
                                     const ACE_QoS_Params &qos_params,
                                     int reuse_addr,
                                     const ACE_TCHAR *net_if,
                                     int protocol_family,
                                     int protocol,
                                     ACE_Protocol_Info *protocolinfo,
                                     ACE_SOCK_GROUP g,
                                     u_long flags,
                                     ACE_QoS_Session *qos_session)
{
  ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::subscribe");

  if (this->open (mcast_addr,
                  qos_params,
                  protocol_family,
                  protocol,
                  protocolinfo,
                  g,
                  flags,
                  reuse_addr) == -1)
    return -1;

  // The following method call only applies to Win32 currently.
  int result = this->subscribe_ifs (mcast_addr,
                                    qos_params,
                                    net_if,
                                    protocol_family,
                                    protocol,
                                    reuse_addr,
                                    protocolinfo);
  // Check for the "short-circuit" return value of 1 (for NT).
  if (result != 0)
    return result;

  // Tell network device driver to read datagrams with a
  // <mcast_request_if_> IP interface.
  else
    {
      // Check if the mcast_addr passed into this method is the
      // same as the QoS session address.
      if (qos_session != 0 && mcast_addr == qos_session->dest_addr ())
        {
          // Subscribe to the QoS session.
          if (this->qos_manager_.join_qos_session (qos_session) == -1)
            ACE_ERROR_RETURN ((LM_ERROR,
                               ACE_TEXT ("Unable to join QoS Session\n")),
                              -1);
        }
      else
        {
          if (this->close () != 0)
            ACE_ERROR ((LM_ERROR,
                        ACE_TEXT ("Unable to close socket\n")));
            ACE_ERROR_RETURN ((LM_ERROR,
                               ACE_TEXT ("Dest Addr in the QoS Session does")
                               ACE_TEXT (" not match the address passed into")
                               ACE_TEXT (" subscribe\n")),
                              -1);
        }

      ip_mreq ret_mreq;
      this->make_multicast_ifaddr (&ret_mreq, mcast_addr, net_if);

      // XX This is windows stuff only. fredk
      if (ACE_OS::join_leaf (this->get_handle (),
                             reinterpret_cast<const sockaddr *> (&ret_mreq.IMR_MULTIADDR.s_addr),
                             sizeof ret_mreq.IMR_MULTIADDR.s_addr,
                             qos_params) == ACE_INVALID_HANDLE
          && errno != ENOTSUP)
        return -1;

      else
        if (qos_params.socket_qos () != 0 && qos_session != 0)
          qos_session->qos (*(qos_params.socket_qos ()));

      return 0;
    }
}