blob: 283aa390f352a35fa045775c237e4da476395663 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libguac: guacamole/socket.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libguac
&#160;<span id="projectnumber">1.1.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_6bb9fad85c98b48a11165f494b9f53ce.html">guacamole</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">socket.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Defines the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object and functionss for using and manipulating it.
<a href="#details">More...</a></p>
<p><a href="socket_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structguac__socket.html">guac_socket</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The core I/O object of Guacamole. <a href="structguac__socket.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a7e5859b812923b894779f59353fdadb4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a7e5859b812923b894779f59353fdadb4">guac_socket_alloc</a> ()</td></tr>
<tr class="memdesc:a7e5859b812923b894779f59353fdadb4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates a new, completely blank <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a>. <a href="#a7e5859b812923b894779f59353fdadb4">More...</a><br /></td></tr>
<tr class="separator:a7e5859b812923b894779f59353fdadb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a376df8efcc02a7104504f104433884ed"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a376df8efcc02a7104504f104433884ed">guac_socket_free</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket)</td></tr>
<tr class="memdesc:a376df8efcc02a7104504f104433884ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> and all associated resources. <a href="#a376df8efcc02a7104504f104433884ed">More...</a><br /></td></tr>
<tr class="separator:a376df8efcc02a7104504f104433884ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d8c5111a8234c7785ae23f379f7db03"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a1d8c5111a8234c7785ae23f379f7db03">guac_socket_require_keep_alive</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket)</td></tr>
<tr class="memdesc:a1d8c5111a8234c7785ae23f379f7db03"><td class="mdescLeft">&#160;</td><td class="mdescRight">Declares that the given socket must automatically send a keep-alive ping to ensure neither side of the socket times out while the socket is open. <a href="#a1d8c5111a8234c7785ae23f379f7db03">More...</a><br /></td></tr>
<tr class="separator:a1d8c5111a8234c7785ae23f379f7db03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00c8f00ab54c42e42c9f489caf5478b1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a00c8f00ab54c42e42c9f489caf5478b1">guac_socket_instruction_begin</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket)</td></tr>
<tr class="memdesc:a00c8f00ab54c42e42c9f489caf5478b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Marks the beginning of a Guacamole protocol instruction. <a href="#a00c8f00ab54c42e42c9f489caf5478b1">More...</a><br /></td></tr>
<tr class="separator:a00c8f00ab54c42e42c9f489caf5478b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a603c23b24e2e2e95eeb2ce08d8115e94"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a603c23b24e2e2e95eeb2ce08d8115e94">guac_socket_instruction_end</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket)</td></tr>
<tr class="memdesc:a603c23b24e2e2e95eeb2ce08d8115e94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Marks the end of a Guacamole protocol instruction. <a href="#a603c23b24e2e2e95eeb2ce08d8115e94">More...</a><br /></td></tr>
<tr class="separator:a603c23b24e2e2e95eeb2ce08d8115e94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a076f62b9b6082260462e18ca77c64e7a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a076f62b9b6082260462e18ca77c64e7a">guac_socket_open</a> (int fd)</td></tr>
<tr class="memdesc:a076f62b9b6082260462e18ca77c64e7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates and initializes a new <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object with the given open file descriptor. <a href="#a076f62b9b6082260462e18ca77c64e7a">More...</a><br /></td></tr>
<tr class="separator:a076f62b9b6082260462e18ca77c64e7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af23ab23c93eb09eac0e15a87f5690bda"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#af23ab23c93eb09eac0e15a87f5690bda">guac_socket_nest</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *parent, int index)</td></tr>
<tr class="memdesc:af23ab23c93eb09eac0e15a87f5690bda"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates and initializes a new <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> which writes all data via nest instructions to the given existing, open <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a>. <a href="#af23ab23c93eb09eac0e15a87f5690bda">More...</a><br /></td></tr>
<tr class="separator:af23ab23c93eb09eac0e15a87f5690bda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add9c80240912b0c8d309cf7de94f5305"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#add9c80240912b0c8d309cf7de94f5305">guac_socket_tee</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *primary, <a class="el" href="structguac__socket.html">guac_socket</a> *secondary)</td></tr>
<tr class="memdesc:add9c80240912b0c8d309cf7de94f5305"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates and initializes a new <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> which delegates all socket operations to the given primary socket, while simultaneously duplicating all written data to the secondary socket. <a href="#add9c80240912b0c8d309cf7de94f5305">More...</a><br /></td></tr>
<tr class="separator:add9c80240912b0c8d309cf7de94f5305"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b570fec1d86f1eb09e057d4bbed3be6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a2b570fec1d86f1eb09e057d4bbed3be6">guac_socket_broadcast</a> (<a class="el" href="structguac__client.html">guac_client</a> *client)</td></tr>
<tr class="memdesc:a2b570fec1d86f1eb09e057d4bbed3be6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates and initializes a new <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> which duplicates all instructions written across the sockets of each connected user of the given <a class="el" href="structguac__client.html" title="Guacamole proxy client. ">guac_client</a>. <a href="#a2b570fec1d86f1eb09e057d4bbed3be6">More...</a><br /></td></tr>
<tr class="separator:a2b570fec1d86f1eb09e057d4bbed3be6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57a963e37377de2104c2d785980ff400"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a57a963e37377de2104c2d785980ff400">guac_socket_write_int</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket, int64_t i)</td></tr>
<tr class="memdesc:a57a963e37377de2104c2d785980ff400"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes the given unsigned int to the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object. <a href="#a57a963e37377de2104c2d785980ff400">More...</a><br /></td></tr>
<tr class="separator:a57a963e37377de2104c2d785980ff400"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0cb48c7896361b522ae5a222a3b5efc"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#ad0cb48c7896361b522ae5a222a3b5efc">guac_socket_write_string</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket, const char *str)</td></tr>
<tr class="memdesc:ad0cb48c7896361b522ae5a222a3b5efc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes the given string to the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object. <a href="#ad0cb48c7896361b522ae5a222a3b5efc">More...</a><br /></td></tr>
<tr class="separator:ad0cb48c7896361b522ae5a222a3b5efc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7ec68bc42436ba316805718c292c510"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#ac7ec68bc42436ba316805718c292c510">guac_socket_write_base64</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket, const void *buf, size_t count)</td></tr>
<tr class="memdesc:ac7ec68bc42436ba316805718c292c510"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes the given binary data to the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object as base64- encoded data. <a href="#ac7ec68bc42436ba316805718c292c510">More...</a><br /></td></tr>
<tr class="separator:ac7ec68bc42436ba316805718c292c510"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb6eb960de27526bc96e1f9af797e2c4"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#adb6eb960de27526bc96e1f9af797e2c4">guac_socket_write</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket, const void *buf, size_t count)</td></tr>
<tr class="memdesc:adb6eb960de27526bc96e1f9af797e2c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes the given data to the specified socket. <a href="#adb6eb960de27526bc96e1f9af797e2c4">More...</a><br /></td></tr>
<tr class="separator:adb6eb960de27526bc96e1f9af797e2c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5d6846212d792c5bce7f8a4fd46cd31"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#af5d6846212d792c5bce7f8a4fd46cd31">guac_socket_read</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket, void *buf, size_t count)</td></tr>
<tr class="memdesc:af5d6846212d792c5bce7f8a4fd46cd31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempts to read data from the socket, filling up to the specified number of bytes in the given buffer. <a href="#af5d6846212d792c5bce7f8a4fd46cd31">More...</a><br /></td></tr>
<tr class="separator:af5d6846212d792c5bce7f8a4fd46cd31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09d5f60d75c57640a4c483d42445c1ab"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a09d5f60d75c57640a4c483d42445c1ab">guac_socket_flush_base64</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket)</td></tr>
<tr class="memdesc:a09d5f60d75c57640a4c483d42445c1ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flushes the base64 buffer, writing padding characters as necessary. <a href="#a09d5f60d75c57640a4c483d42445c1ab">More...</a><br /></td></tr>
<tr class="separator:a09d5f60d75c57640a4c483d42445c1ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ababc834d5812e006b55a79da417bfe12"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#ababc834d5812e006b55a79da417bfe12">guac_socket_flush</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket)</td></tr>
<tr class="memdesc:ababc834d5812e006b55a79da417bfe12"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flushes the write buffer. <a href="#ababc834d5812e006b55a79da417bfe12">More...</a><br /></td></tr>
<tr class="separator:ababc834d5812e006b55a79da417bfe12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41b0d7a25ccda3d0ae20143880cf53b7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a41b0d7a25ccda3d0ae20143880cf53b7">guac_socket_select</a> (<a class="el" href="structguac__socket.html">guac_socket</a> *socket, int usec_timeout)</td></tr>
<tr class="memdesc:a41b0d7a25ccda3d0ae20143880cf53b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for input to be available on the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object until the specified timeout elapses. <a href="#a41b0d7a25ccda3d0ae20143880cf53b7">More...</a><br /></td></tr>
<tr class="separator:a41b0d7a25ccda3d0ae20143880cf53b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Defines the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object and functionss for using and manipulating it. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a7e5859b812923b894779f59353fdadb4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e5859b812923b894779f59353fdadb4">&#9670;&nbsp;</a></span>guac_socket_alloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structguac__socket.html">guac_socket</a>* guac_socket_alloc </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates a new, completely blank <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a>. </p>
<p>This <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> will do absolutely nothing when used unless its handlers are defined.</p>
<dl class="section return"><dt>Returns</dt><dd>A newly-allocated <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a>, or NULL if the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> could not be allocated. </dd></dl>
</div>
</div>
<a id="a2b570fec1d86f1eb09e057d4bbed3be6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2b570fec1d86f1eb09e057d4bbed3be6">&#9670;&nbsp;</a></span>guac_socket_broadcast()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structguac__socket.html">guac_socket</a>* guac_socket_broadcast </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__client.html">guac_client</a> *&#160;</td>
<td class="paramname"><em>client</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates and initializes a new <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> which duplicates all instructions written across the sockets of each connected user of the given <a class="el" href="structguac__client.html" title="Guacamole proxy client. ">guac_client</a>. </p>
<p>The returned socket is a write-only socket. Attempts to read from the socket will fail. If a write occurs while no users are connected, that write will simply be dropped.</p>
<p>Return values (error codes) from each user's socket will not affect the in-progress write, but each failing user will be forcibly stopped with <a class="el" href="user_8h.html#a8216ec7024947564fb4ea6b8b0b07eaf" title="Signals the given user that it must disconnect, or advises cooperating services that the given user i...">guac_user_stop()</a>.</p>
<p>If an error occurs while allocating the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object, NULL is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">client</td><td>The client associated with the group of connected users across which duplicates of all instructions should be written.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A write-only <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object which broadcasts copies of all instructions written across all connected users of the given <a class="el" href="structguac__client.html" title="Guacamole proxy client. ">guac_client</a>, or NULL if an error occurs while allocating the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object. </dd></dl>
</div>
</div>
<a id="ababc834d5812e006b55a79da417bfe12"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ababc834d5812e006b55a79da417bfe12">&#9670;&nbsp;</a></span>guac_socket_flush()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ssize_t guac_socket_flush </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Flushes the write buffer. </p>
<p>If an error occurs while writing, a non-zero value is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object to flush </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero on success, or non-zero if an error occurs during flush. </dd></dl>
</div>
</div>
<a id="a09d5f60d75c57640a4c483d42445c1ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a09d5f60d75c57640a4c483d42445c1ab">&#9670;&nbsp;</a></span>guac_socket_flush_base64()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ssize_t guac_socket_flush_base64 </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Flushes the base64 buffer, writing padding characters as necessary. </p>
<p>If an error occurs while writing, a non-zero value is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object to flush </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero on success, or non-zero if an error occurs during flush. </dd></dl>
</div>
</div>
<a id="a376df8efcc02a7104504f104433884ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a376df8efcc02a7104504f104433884ed">&#9670;&nbsp;</a></span>guac_socket_free()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void guac_socket_free </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Frees the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> and all associated resources. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> to free. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a00c8f00ab54c42e42c9f489caf5478b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a00c8f00ab54c42e42c9f489caf5478b1">&#9670;&nbsp;</a></span>guac_socket_instruction_begin()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void guac_socket_instruction_begin </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Marks the beginning of a Guacamole protocol instruction. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> beginning an instruction. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a603c23b24e2e2e95eeb2ce08d8115e94"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a603c23b24e2e2e95eeb2ce08d8115e94">&#9670;&nbsp;</a></span>guac_socket_instruction_end()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void guac_socket_instruction_end </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Marks the end of a Guacamole protocol instruction. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> ending an instruction. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="af23ab23c93eb09eac0e15a87f5690bda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af23ab23c93eb09eac0e15a87f5690bda">&#9670;&nbsp;</a></span>guac_socket_nest()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structguac__socket.html">guac_socket</a>* guac_socket_nest </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>parent</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>index</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates and initializes a new <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> which writes all data via nest instructions to the given existing, open <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a>. </p>
<p>Freeing the returned <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> has no effect on the underlying, nested <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a>.</p>
<p>If an error occurs while allocating the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object, NULL is returned, and guac_error is set appropriately.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>The "nest" instruction and the corresponding <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> implementation are no longer necessary, having been replaced by the streaming instructions ("blob", "ack", "end"). Code using nested sockets or the "nest" instruction should instead write to a normal socket directly.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">parent</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> this new <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> should write nest instructions to. </td></tr>
<tr><td class="paramname">index</td><td>The stream index to use for the written nest instructions. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A newly allocated <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object associated with the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> and stream index, or NULL if an error occurs while allocating the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object. </dd></dl>
</div>
</div>
<a id="a076f62b9b6082260462e18ca77c64e7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a076f62b9b6082260462e18ca77c64e7a">&#9670;&nbsp;</a></span>guac_socket_open()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structguac__socket.html">guac_socket</a>* guac_socket_open </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>fd</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates and initializes a new <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object with the given open file descriptor. </p>
<p>The file descriptor will be automatically closed when the allocated <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> is freed.</p>
<p>If an error occurs while allocating the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object, NULL is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">fd</td><td>An open file descriptor that this <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object should manage. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A newly allocated <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object associated with the given file descriptor, or NULL if an error occurs while allocating the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object. </dd></dl>
</div>
</div>
<a id="af5d6846212d792c5bce7f8a4fd46cd31"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af5d6846212d792c5bce7f8a4fd46cd31">&#9670;&nbsp;</a></span>guac_socket_read()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ssize_t guac_socket_read </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Attempts to read data from the socket, filling up to the specified number of bytes in the given buffer. </p>
<p>If an error occurs while writing, a non-zero value is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> to read from. </td></tr>
<tr><td class="paramname">buf</td><td>The buffer to read bytes into. </td></tr>
<tr><td class="paramname">count</td><td>The maximum number of bytes to read. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes read, or non-zero if an error occurs while reading. </dd></dl>
</div>
</div>
<a id="a1d8c5111a8234c7785ae23f379f7db03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d8c5111a8234c7785ae23f379f7db03">&#9670;&nbsp;</a></span>guac_socket_require_keep_alive()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void guac_socket_require_keep_alive </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Declares that the given socket must automatically send a keep-alive ping to ensure neither side of the socket times out while the socket is open. </p>
<p>This ping will take the form of a "nop" instruction.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> to declare as requiring an automatic keep-alive ping. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a41b0d7a25ccda3d0ae20143880cf53b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a41b0d7a25ccda3d0ae20143880cf53b7">&#9670;&nbsp;</a></span>guac_socket_select()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int guac_socket_select </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>usec_timeout</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Waits for input to be available on the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object until the specified timeout elapses. </p>
<p>If an error occurs while waiting, a negative value is returned, and guac_error is set appropriately.</p>
<p>If a timeout occurs while waiting, zero value is returned, and guac_error is set to GUAC_STATUS_INPUT_TIMEOUT.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object to wait for. </td></tr>
<tr><td class="paramname">usec_timeout</td><td>The maximum number of microseconds to wait for data, or -1 to potentially wait forever. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Positive on success, zero if the timeout elapsed and no data is available, negative on error. </dd></dl>
</div>
</div>
<a id="add9c80240912b0c8d309cf7de94f5305"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add9c80240912b0c8d309cf7de94f5305">&#9670;&nbsp;</a></span>guac_socket_tee()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structguac__socket.html">guac_socket</a>* guac_socket_tee </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>primary</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>secondary</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates and initializes a new <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> which delegates all socket operations to the given primary socket, while simultaneously duplicating all written data to the secondary socket. </p>
<p>Freeing the returned <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> will free both primary and secondary sockets.</p>
<p>Return values (error codes) will come only from the primary socket. Locks (like those used by <a class="el" href="socket_8h.html#a00c8f00ab54c42e42c9f489caf5478b1" title="Marks the beginning of a Guacamole protocol instruction. ">guac_socket_instruction_begin()</a> and <a class="el" href="socket_8h.html#a603c23b24e2e2e95eeb2ce08d8115e94" title="Marks the end of a Guacamole protocol instruction. ">guac_socket_instruction_end()</a>) will affect only the primary socket.</p>
<p>If an error occurs while allocating the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object, NULL is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">primary</td><td>The primary <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> to which all socket operations should be delegated. The error codes returned by socket operations, if any, will always come from this socket. This socket will also be the only socket locked when instructions begin (or unlocked when instructions end).</td></tr>
<tr><td class="paramname">secondary</td><td>The secondary <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> to which all data written to the primary <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> should be copied. If an error prevents the write from succeeding, that error will be ignored. Only errors from the primary <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> will be acknowledged.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A newly allocated <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object associated with the given primary and secondary sockets, or NULL if an error occurs while allocating the <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object. </dd></dl>
</div>
</div>
<a id="adb6eb960de27526bc96e1f9af797e2c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb6eb960de27526bc96e1f9af797e2c4">&#9670;&nbsp;</a></span>guac_socket_write()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ssize_t guac_socket_write </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void *&#160;</td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes the given data to the specified socket. </p>
<p>The data written may be buffered until the buffer is flushed automatically or manually.</p>
<p>If an error occurs while writing, a non-zero value is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object to write to. </td></tr>
<tr><td class="paramname">buf</td><td>A buffer containing the data to write. </td></tr>
<tr><td class="paramname">count</td><td>The number of bytes to write. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero on success, or non-zero if an error occurs while writing. </dd></dl>
</div>
</div>
<a id="ac7ec68bc42436ba316805718c292c510"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7ec68bc42436ba316805718c292c510">&#9670;&nbsp;</a></span>guac_socket_write_base64()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ssize_t guac_socket_write_base64 </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void *&#160;</td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes the given binary data to the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object as base64- encoded data. </p>
<p>The data written may be buffered until the buffer is flushed automatically or manually. Beware that, because base64 data is buffered on top of the write buffer already used, a call to <a class="el" href="socket_8h.html#a09d5f60d75c57640a4c483d42445c1ab" title="Flushes the base64 buffer, writing padding characters as necessary. ">guac_socket_flush_base64()</a> MUST be made before non-base64 writes (or writes of an independent block of base64 data) can be made.</p>
<p>If an error occurs while writing, a non-zero value is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object to write to. </td></tr>
<tr><td class="paramname">buf</td><td>A buffer containing the data to write. </td></tr>
<tr><td class="paramname">count</td><td>The number of bytes to write. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero on success, or non-zero if an error occurs while writing. </dd></dl>
</div>
</div>
<a id="a57a963e37377de2104c2d785980ff400"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a57a963e37377de2104c2d785980ff400">&#9670;&nbsp;</a></span>guac_socket_write_int()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ssize_t guac_socket_write_int </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>i</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes the given unsigned int to the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object. </p>
<p>The data written may be buffered until the buffer is flushed automatically or manually.</p>
<p>If an error occurs while writing, a non-zero value is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object to write to. </td></tr>
<tr><td class="paramname">i</td><td>The unsigned int to write. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero on success, or non-zero if an error occurs while writing. </dd></dl>
</div>
</div>
<a id="ad0cb48c7896361b522ae5a222a3b5efc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad0cb48c7896361b522ae5a222a3b5efc">&#9670;&nbsp;</a></span>guac_socket_write_string()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ssize_t guac_socket_write_string </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__socket.html">guac_socket</a> *&#160;</td>
<td class="paramname"><em>socket</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>str</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes the given string to the given <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object. </p>
<p>The data written may be buffered until the buffer is flushed automatically or manually.</p>
<p>If an error occurs while writing, a non-zero value is returned, and guac_error is set appropriately.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">socket</td><td>The <a class="el" href="structguac__socket.html" title="The core I/O object of Guacamole. ">guac_socket</a> object to write to. </td></tr>
<tr><td class="paramname">str</td><td>The string to write. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero on success, or non-zero if an error occurs while writing. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>