{"id":2644,"date":"2019-11-15T18:11:33","date_gmt":"2019-11-15T17:11:33","guid":{"rendered":"https:\/\/ridgesolutions.ie\/?p=2644"},"modified":"2022-05-17T16:08:09","modified_gmt":"2022-05-17T15:08:09","slug":"fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries","status":"publish","type":"post","link":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/","title":{"rendered":"Fire-And-Forget wrapper for sending simple UDP data using boost::asio libraries"},"content":{"rendered":"<p>So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network &#8211; really simple stuff, transmit a string to an IP address on a given port, <b>Fire And Forget<\/b>, send a string from here to there &#8211; end of story!<\/p>\n<p>Now my normal port of call these days for networking in C++ is to reach for the <b>boost::asio<\/b> libs, as mentioned <a href=\"https:\/\/ridgesolutions.ie\/index.php\/2019\/06\/06\/boost-asio-simple-udp-send-packet-example\/\">here<\/a>, this library is very powerful and flexible and can handle a huge number of different networking scenarios.<\/p>\n<p>All well and good, but sometimes I wish that I could just call a simple function and not have to remember or worry about all of boost stuff as it can be a proper head-wreck and there&#8217;s a lot of typing as the namespaces are so long! Python has me really spoiled, it makes so many things simple and easy to use!<\/p>\n<p>So I wrote a little C++ wrapper class that just has 1 function called <b>send()<\/b> that can send a string or the contents of a binary buffer, the class is called: <b>boost_udp_send_faf<\/b> (faf stands for Fire-and-Forget!).<\/p>\n<p>It is a very basic wrapper around the boost libs and only handles very simple transmission use-cases, but these use-cases probably cover about 80% of my UDP transmission needs!<\/p>\n<p>To use the class for a single Fire-and-Forget send:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\">\/\/\r\n#include \"boost_udp_send_faf.h\"\r\nboost_udp_send_faf(\"192.168.1.44\", 8861).send(\"The message!\");\r\n\/\/<\/pre>\n<p>This sends the message to 192.168.1.44 on port 8861.<\/p>\n<p>If your program needs send multiple datagrams, then we can keep the socket open and reuse the end-point like this:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\">\/\/\r\n#include \"boost_udp_send_faf.h\"\r\nboost_udp_send_faf sender(\"192.168.1.44\", 8861);\r\nfor (auto i = 0; i != 10; i++) { sender.send(\"Lots of messages! :-\/\"); }\r\n\/\/<\/pre>\n<p>The socket will remain open until the &#8216;sender&#8217; object goes out of scope.<\/p>\n<p>It&#8217;s probably best to add exception handling to your calls as they can fail for lots of reasons and as ever networking is very flaky &amp; unpredictable.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\">\/\/\r\ntry {\r\n    boost_udp_send_faf(\"192.168.1.44\", 8861).send(\"The message!\");\r\n} catch (const boost::system::system_error&amp; ex) { cerr &lt;&lt; \"Send failed: \" &lt;&lt; ex.what(); }\r\n\/\/<\/pre>\n<p>This will also ensure that the socket is closed once the message is sent as the object will go out of scope when execution leaves the try block.<\/p>\n<p>The code for boost_udp_send_faf can be found in <a href=\"https:\/\/github.com\/kgodden\/boost_udp_send_faf\">this<\/a> repo on GitHub, but I have in-lined it below as well.<\/p>\n<p>For an easier way to receive UDP data see: <a title=\"boost_udp_receive_rar\" href=\"https:\/\/www.ridgesolutions.ie\/index.php\/2022\/05\/17\/simple-wrapper-of-boostasio-for-receiving-datagrams\/\">boost_udp_receive_rar <\/a><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\">#pragma once\r\n\r\n\/\/   Copyright 2018 Kevin Godden\r\n\/\/\r\n\/\/   Licensed under the Apache License, Version 2.0 (the \"License\");\r\n\/\/   you may not use this file except in compliance with the License.\r\n\/\/   You may obtain a copy of the License at\r\n\/\/\r\n\/\/       http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n\/\/\r\n\/\/   Unless required by applicable law or agreed to in writing, software\r\n\/\/   distributed under the License is distributed on an \"AS IS\" BASIS,\r\n\/\/   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n\/\/   See the License for the specific language governing permissions and\r\n\/\/   limitations under the License.\r\n\r\n#include &lt;boost\/asio.hpp&gt;\r\n#include &lt;string&gt;\r\n\r\n\/\/\r\n\/\/ Fire-and-Forget (FAF) transmission for UDP\r\n\/\/ using the boost::asio lib. Very simple wrapper\r\n\/\/ around the boost libs.\r\n\/\/\r\n\/\/ Can throw the following exception:\r\n\/\/\tboost::system::system_error\r\n\/\/\r\n\/\/ Synopsis ---&gt;\r\n\/\/\r\n\/\/ For a single Fire-and-Forget send:\r\n\/\/\r\n\/\/ #include \"boost_udp_send_faf.h\"\r\n\/\/\r\n\/\/ boost_udp_send_faf(\"192.168.1.44\", 8861).send(\"The message!\");\r\n\/\/\r\n\/\/\r\n\/\/ To send multiple datagrams while keeping the socket open and\r\n\/\/ reusing end-point:\r\n\/\/\r\n\/\/ #include \"boost_udp_send_faf.h\"\r\n\/\/\r\n\/\/ boost_udp_send_faf sender(\"192.168.1.44\", 8861);\r\n\/\/\t\t\r\n\/\/ for (auto i = 0; i != 10; i++) {\r\n\/\/     sender.send(\"Lots of messages! :-\/\");\r\n\/\/ }\r\n\/\/\r\n\/\/ The socket will remain open while the boost_udp_send_faf object is in scope\r\n\/\/ so to control when the socket is closed, control the scope of the object.\r\n\/\/\r\n\/\/ If you want to do anything fancy like using scatter-gather buffers etc. then\r\n\/\/ just use the boost libs!  This is for real simple stuff!\r\n\/\/\r\n\r\n\r\nclass boost_udp_send_faf {\r\n    boost::asio::io_service io_service;\r\n    boost::asio::ip::udp::socket socket;\r\n    boost::asio::ip::udp::endpoint remote_endpoint;\r\n\r\npublic:\r\n\r\n    boost_udp_send_faf(const std::string&amp; ip_address, const int port, const bool broadcast = false) : socket(io_service) {\r\n        \r\n        \/\/ Open socket\r\n        socket.open(boost::asio::ip::udp::v4());\r\n\r\n        \/\/ I wouldn't recommend broadcasting unless you are\r\n        \/\/ in complete control of your subnet and know\r\n        \/\/ what's on it and how it will react\r\n        if (broadcast) {\r\n            boost::asio::socket_base::broadcast option(true);\r\n            socket.set_option(option);\r\n        }\r\n\r\n        \/\/ make endpoint\r\n        remote_endpoint = boost::asio::ip::udp::endpoint(boost::asio::ip::address::from_string(ip_address.c_str()), port);\r\n    }\r\n\r\n    \/\/ Send a string to the preconfigured endpoint\r\n    \/\/ via the open socket.\r\n    void send(const std::string&amp; message) {\r\n        boost::system::error_code ignored_error;\r\n        socket.send_to(boost::asio::buffer(message), remote_endpoint, 0, ignored_error);\r\n    }\r\n\r\n    \/\/ Send some binary data to the preconfigured endpoint\r\n    \/\/ via the open socket.\r\n    void send(const unsigned char* data, const int len) {\r\n        boost::system::error_code ignored_error;\r\n        socket.send_to(boost::asio::buffer(data, len), remote_endpoint, 0, ignored_error);\r\n    }\r\n};<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network &#8211; really simple stuff, transmit a string to an IP address on a given port, Fire And Forget, send a string from [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[301],"tags":[],"class_list":["post-2644","post","type-post","status-publish","format-standard","hentry","category-by-kevin-godden"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network - really simple stuff, transmit a string to an IP address on a given port, Fire And Forget, send a string from\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Kevin Godden\"\/>\n\t<meta name=\"google-site-verification\" content=\"Kyj52YLp6GOPA44PVBffo9fjW8rgWHYYRF0ZYjfy6ss\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Systems and Embedded Software Engineering, Ireland. | Some thoughts of a busy Computer Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Wrapper for sending of UDP data using boost::asio libraries\" \/>\n\t\t<meta property=\"og:description\" content=\"So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network - really simple stuff, transmit a string to an IP address on a given port, Fire And Forget, send a string from\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-11-15T17:11:33+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-05-17T15:08:09+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Wrapper for sending of UDP data using boost::asio libraries\" \/>\n\t\t<meta name=\"twitter:description\" content=\"So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network - really simple stuff, transmit a string to an IP address on a given port, Fire And Forget, send a string from\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#article\",\"name\":\"Wrapper for sending of UDP data using boost::asio libraries\",\"headline\":\"Fire-And-Forget wrapper for sending simple UDP data using boost::asio libraries\",\"author\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/wp-content\\\/uploads\\\/2013\\\/09\\\/ridge_logo1.jpg\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#articleImage\",\"width\":400,\"height\":81},\"datePublished\":\"2019-11-15T18:11:33+00:00\",\"dateModified\":\"2022-05-17T16:08:09+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#webpage\"},\"articleSection\":\"By Ridge Solutions\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.ridgesolutions.ie\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/by-kevin-godden\\\/#listItem\",\"name\":\"By Ridge Solutions\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/by-kevin-godden\\\/#listItem\",\"position\":2,\"name\":\"By Ridge Solutions\",\"item\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/by-kevin-godden\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#listItem\",\"name\":\"Fire-And-Forget wrapper for sending simple UDP data using boost::asio libraries\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#listItem\",\"position\":3,\"name\":\"Fire-And-Forget wrapper for sending simple UDP data using boost::asio libraries\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/by-kevin-godden\\\/#listItem\",\"name\":\"By Ridge Solutions\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#organization\",\"name\":\"Ridge Solutions, Software Development and Software Engineering, Ireland.\",\"description\":\"Some thoughts of a busy Computer Engineer\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/wp-content\\\/uploads\\\/2013\\\/09\\\/ridge_logo1.jpg\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#organizationLogo\",\"width\":400,\"height\":81},\"image\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#organizationLogo\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/\",\"name\":\"Kevin Godden\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2833f41e59a25cf2a9741a05ec383bfdd278762a5e0798a90940e7ab0a107a2?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kevin Godden\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#webpage\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/\",\"name\":\"Wrapper for sending of UDP data using boost::asio libraries\",\"description\":\"So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network - really simple stuff, transmit a string to an IP address on a given port, Fire And Forget, send a string from\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2019\\\/11\\\/15\\\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\"},\"datePublished\":\"2019-11-15T18:11:33+00:00\",\"dateModified\":\"2022-05-17T16:08:09+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#website\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/\",\"name\":\"Ridge Solutions, Software Development and Software Engineering, Ireland.\",\"description\":\"Some thoughts of a busy Computer Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Wrapper for sending of UDP data using boost::asio libraries","description":"So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network - really simple stuff, transmit a string to an IP address on a given port, Fire And Forget, send a string from","canonical_url":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"Kyj52YLp6GOPA44PVBffo9fjW8rgWHYYRF0ZYjfy6ss","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#article","name":"Wrapper for sending of UDP data using boost::asio libraries","headline":"Fire-And-Forget wrapper for sending simple UDP data using boost::asio libraries","author":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author"},"publisher":{"@id":"https:\/\/www.ridgesolutions.ie\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.ridgesolutions.ie\/wp-content\/uploads\/2013\/09\/ridge_logo1.jpg","@id":"https:\/\/www.ridgesolutions.ie\/#articleImage","width":400,"height":81},"datePublished":"2019-11-15T18:11:33+00:00","dateModified":"2022-05-17T16:08:09+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#webpage"},"isPartOf":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#webpage"},"articleSection":"By Ridge Solutions"},{"@type":"BreadcrumbList","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie#listItem","position":1,"name":"Home","item":"https:\/\/www.ridgesolutions.ie","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/by-kevin-godden\/#listItem","name":"By Ridge Solutions"}},{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/by-kevin-godden\/#listItem","position":2,"name":"By Ridge Solutions","item":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/by-kevin-godden\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#listItem","name":"Fire-And-Forget wrapper for sending simple UDP data using boost::asio libraries"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#listItem","position":3,"name":"Fire-And-Forget wrapper for sending simple UDP data using boost::asio libraries","previousItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/by-kevin-godden\/#listItem","name":"By Ridge Solutions"}}]},{"@type":"Organization","@id":"https:\/\/www.ridgesolutions.ie\/#organization","name":"Ridge Solutions, Software Development and Software Engineering, Ireland.","description":"Some thoughts of a busy Computer Engineer","url":"https:\/\/www.ridgesolutions.ie\/","logo":{"@type":"ImageObject","url":"https:\/\/www.ridgesolutions.ie\/wp-content\/uploads\/2013\/09\/ridge_logo1.jpg","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#organizationLogo","width":400,"height":81},"image":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#organizationLogo"}},{"@type":"Person","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author","url":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/","name":"Kevin Godden","image":{"@type":"ImageObject","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2833f41e59a25cf2a9741a05ec383bfdd278762a5e0798a90940e7ab0a107a2?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kevin Godden"}},{"@type":"WebPage","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#webpage","url":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/","name":"Wrapper for sending of UDP data using boost::asio libraries","description":"So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network - really simple stuff, transmit a string to an IP address on a given port, Fire And Forget, send a string from","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.ridgesolutions.ie\/#website"},"breadcrumb":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/#breadcrumblist"},"author":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author"},"creator":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author"},"datePublished":"2019-11-15T18:11:33+00:00","dateModified":"2022-05-17T16:08:09+00:00"},{"@type":"WebSite","@id":"https:\/\/www.ridgesolutions.ie\/#website","url":"https:\/\/www.ridgesolutions.ie\/","name":"Ridge Solutions, Software Development and Software Engineering, Ireland.","description":"Some thoughts of a busy Computer Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.ridgesolutions.ie\/#organization"}}]},"og:locale":"en_US","og:site_name":"Systems and Embedded Software Engineering, Ireland. | Some thoughts of a busy Computer Engineer","og:type":"article","og:title":"Wrapper for sending of UDP data using boost::asio libraries","og:description":"So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network - really simple stuff, transmit a string to an IP address on a given port, Fire And Forget, send a string from","og:url":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/","article:published_time":"2019-11-15T17:11:33+00:00","article:modified_time":"2022-05-17T15:08:09+00:00","twitter:card":"summary","twitter:title":"Wrapper for sending of UDP data using boost::asio libraries","twitter:description":"So I had a problem, as part of an embedded software system I was working on I needed to periodically send some GPS information via UDP datagrams to other devices on the network - really simple stuff, transmit a string to an IP address on a given port, Fire And Forget, send a string from"},"aioseo_meta_data":{"post_id":"2644","title":"Wrapper for sending of UDP data using boost::asio libraries","description":null,"keywords":[{"label":"UDP","value":"UDP"},{"label":"boost::asio","value":"boost::asio"},{"label":"C++","value":"C++"},{"label":"simple","value":"simple"},{"label":"send","value":"send"}],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":{"id":"aioseo-article-634e729040fb1","slug":"article","graphName":"Article","label":"Article","properties":{"type":"BlogPosting","name":"#post_title","headline":"#post_title","description":"#post_excerpt","image":"","keywords":"","author":{"name":"#author_name","url":"#author_url"},"dates":{"include":true,"datePublished":"","dateModified":""}}},"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-09-13 11:17:54","updated":"2026-08-07 16:46:47","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ridgesolutions.ie\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ridgesolutions.ie\/index.php\/category\/by-kevin-godden\/\" title=\"By Ridge Solutions\">By Ridge Solutions<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tFire-And-Forget wrapper for sending simple UDP data using boost::asio libraries\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.ridgesolutions.ie"},{"label":"By Ridge Solutions","link":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/by-kevin-godden\/"},{"label":"Fire-And-Forget wrapper for sending simple UDP data using boost::asio libraries","link":"https:\/\/www.ridgesolutions.ie\/index.php\/2019\/11\/15\/fire-and-forget-wrapper-for-sending-of-simple-udp-data-using-boostasio-libraries\/"}],"_links":{"self":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/posts\/2644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/comments?post=2644"}],"version-history":[{"count":0,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/posts\/2644\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/media?parent=2644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/categories?post=2644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/tags?post=2644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}