UDPTransportDescriptor.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef _FASTDDS_UDP_TRANSPORT_DESCRIPTOR_
  15. #define _FASTDDS_UDP_TRANSPORT_DESCRIPTOR_
  16. #include <fastdds/rtps/transport/SocketTransportDescriptor.h>
  17. namespace eprosima{
  18. namespace fastdds{
  19. namespace rtps{
  20. /**
  21. * UDP Transport configuration
  22. *
  23. * - bufferSize: length of the buffers used for transmission. Passing
  24. * a buffer of different size will cause transmission to
  25. * fail.
  26. *
  27. * - interfaceWhiteList: Lists the allowed interfaces.
  28. * @ingroup TRANSPORT_MODULE
  29. */
  30. typedef struct UDPTransportDescriptor: public SocketTransportDescriptor
  31. {
  32. virtual ~UDPTransportDescriptor(){}
  33. RTPS_DllAPI UDPTransportDescriptor();
  34. RTPS_DllAPI UDPTransportDescriptor(const UDPTransportDescriptor& t);
  35. uint16_t m_output_udp_socket;
  36. /**
  37. * Whether to use non-blocking calls to send_to().
  38. *
  39. * When set to true, calls to send_to() will return inmediately if the buffer is full, but
  40. * no error will be returned to the upper layer. This means that the application will behave
  41. * as if the datagram is sent but lost (i.e. throughput may be reduced). This value is
  42. * specially useful on high-frequency best-effort writers.
  43. *
  44. * When set to false, calls to send_to() will block until the network buffer has space for the
  45. * datagram. This may hinder performance on high-frequency writers.
  46. */
  47. bool non_blocking_send = false;
  48. } UDPTransportDescriptor;
  49. } // namespace rtps
  50. } // namespace fastdds
  51. } // namespace eprosima
  52. #endif // _FASTDDS_UDP_TRANSPORT_DESCRIPTOR_