<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css"> <title>Erlang -- IC C Protocol Functions</title> </head> <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container"> <script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript"> <!-- function getWinHeight() { var myHeight = 0; if( typeof( window.innerHeight ) == 'number' ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } return myHeight; } function setscrollpos() { var objf=document.getElementById('loadscrollpos'); document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2; } function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', setscrollpos); //--></script><div id="leftnav"><div class="innertube"> <img alt="Erlang logo" src="../../../../doc/erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="index.html">Reference Manual</a><br><a href="release_notes.html">Release Notes</a><br><a href="../pdf/ic-4.2.27.pdf">PDF</a><br><a href="../../../../doc/index.html">Top</a></small><p><strong>ic</strong><br><strong>Reference Manual</strong><br><small>Version 4.2.27</small></p> <br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Table of Contents</strong></small></p> <ul class="flipMenu"> <li id="no" title="ic " expanded="false">ic<ul> <li><a href="ic.html"> Top of manual page </a></li> <li title="ic:gen-1"><a href="ic.html#ic:gen-1">ic:gen/1</a></li> <li title="ic:gen-2"><a href="ic.html#ic:gen-2">ic:gen/2</a></li> </ul> </li> <li id="no" title="ic_clib " expanded="false">ic_clib<ul> <li><a href="ic_clib.html"> Top of manual page </a></li> <li title="CORBA_Environment_alloc"><a href="ic_clib.html#CORBA_Environment_alloc">CORBA_Environment_alloc() </a></li> <li title="CORBA_free"><a href="ic_clib.html#CORBA_free">CORBA_free() </a></li> <li title="CORBA_string_alloc"><a href="ic_clib.html#CORBA_string_alloc">CORBA_string_alloc() </a></li> <li title="CORBA_wstring_alloc"><a href="ic_clib.html#CORBA_wstring_alloc">CORBA_wstring_alloc() </a></li> <li title="CORBA_exception_id"><a href="ic_clib.html#CORBA_exception_id">CORBA_exception_id() </a></li> <li title="CORBA_exception_value"><a href="ic_clib.html#CORBA_exception_value">CORBA_exception_value() </a></li> <li title="CORBA_exc_set"><a href="ic_clib.html#CORBA_exc_set">CORBA_exc_set() </a></li> <li title="oe_server_receive"><a href="ic_clib.html#oe_server_receive">oe_server_receive() </a></li> <li title="oe_server_receive_tmo"><a href="ic_clib.html#oe_server_receive_tmo">oe_server_receive_tmo() </a></li> <li title="oe_exec_switch"><a href="ic_clib.html#oe_exec_switch">oe_exec_switch() </a></li> <li title="oe_merge_maps"><a href="ic_clib.html#oe_merge_maps">oe_merge_maps() </a></li> </ul> </li> <li id="loadscrollpos" title="ic_c_protocol " expanded="true">ic_c_protocol<ul> <li><a href="ic_c_protocol.html"> Top of manual page </a></li> <li title="oe_prepare_notification_encoding"><a href="ic_c_protocol.html#oe_prepare_notification_encoding">oe_prepare_notification_encoding() </a></li> <li title="oe_send_notification"><a href="ic_c_protocol.html#oe_send_notification">oe_send_notification() </a></li> <li title="oe_send_notification_tmo"><a href="ic_c_protocol.html#oe_send_notification_tmo">oe_send_notification_tmo() </a></li> <li title="oe_prepare_request_encoding"><a href="ic_c_protocol.html#oe_prepare_request_encoding">oe_prepare_request_encoding() </a></li> <li title="oe_send_request_and_receive_reply"><a href="ic_c_protocol.html#oe_send_request_and_receive_reply">oe_send_request_and_receive_reply() </a></li> <li title="oe_send_request_and_receive_reply_tmo"><a href="ic_c_protocol.html#oe_send_request_and_receive_reply_tmo">oe_send_request_and_receive_reply_tmo() </a></li> <li title="oe_prepare_reply_decoding"><a href="ic_c_protocol.html#oe_prepare_reply_decoding">oe_prepare_reply_decoding() </a></li> <li title="oe_prepare_request_decoding"><a href="ic_c_protocol.html#oe_prepare_request_decoding">oe_prepare_request_decoding() </a></li> <li title="oe_prepare_reply_encoding"><a href="ic_c_protocol.html#oe_prepare_reply_encoding">oe_prepare_reply_encoding() </a></li> </ul> </li> </ul> </div></div> <div id="content"> <div class="innertube"> <!-- refpage --><center><h1>ic_c_protocol</h1></center> <h3>C LIBRARY</h3> <div class="REFBODY">ic_c_protocol</div> <h3>LIBRARY SUMMARY</h3> <div class="REFBODY">IC C Protocol Functions</div> <h3>DESCRIPTION</h3> <div class="REFBODY"><p> <p>This manual page lists some of the functions of the IC C runtime library that are used internally for the IC protocol. </p> <p>The listed functions are used internally by generated C client and server code. They are documented here for <strong>the advanced user</strong> that want to replace the default protocol (Erlang distribution + gen_server) by his own protocol, For each set of client or sever functions below with prefix <span class="code">oe</span>, the user has to implement his own set of functions, the names of which are obtained by replacing the <span class="code">oe</span> prefix by <span class="code">Prefix</span>. The <span class="code">Prefix</span> has to be set with the option <span class="code">{user_protocol, Prefix}</span> at compile time.</p> <p>The following terminology is used (reflected in names of functions): a <strong>notification</strong> is a message send from client to server, without any reply back (i.e. a <strong>oneway</strong> operation); a <strong>request</strong> is a message sent from client to server, and where a <strong>reply</strong> message is sent back from the server to the client.</p> <p>In order to understand how the functions work and what they do the user <strong>must</strong> study their implementation in the IC C library (source file is <span class="code">ic.c</span>), and also consider how they are used in the C code of ordinary generated client stubs or server skeletons.</p> <p></p> </p></div> <h3><a name="id269445">Client Protocol Functions</a></h3> <div class="REFBODY"> <p>The following functions are used internally by generated C client code.</p> </div> <h3>EXPORTS</h3> <p><a name="oe_prepare_notification_encoding"><span class="bold_code">int oe_prepare_notification_encoding(CORBA_Environment *env)</span></a><br></p> <div class="REFBODY"><p> <p>The result of this function is the beginning of a binary of in external format of the tuple <span class="code">{'$gen_cast', X}</span> where <span class="code">X</span> is not yet filled in. </p> <p>In generated client code this function is the first to be called in the encoding function for each oneway operation.</p> </p></div> <p><a name="oe_send_notification"><span class="bold_code">int oe_send_notification(CORBA_Environment *env)</span></a><br><a name="oe_send_notification_tmo"><span class="bold_code">int oe_send_notification_tmo(CORBA_Environment *env, unsigned int send_ms)</span></a><br></p> <div class="REFBODY"><p> <p>Sends a client notification to a server according to the Erlang distribution + gen_server protocol.</p> <p>The <span class="code">send_ms</span> parameter specified a timeout in milliseconds.</p> </p></div> <p><a name="oe_prepare_request_encoding"><span class="bold_code">int oe_prepare_request_encoding(CORBA_Environment *env)</span></a><br></p> <div class="REFBODY"><p> <p>The result of this function is the beginning of a binary in the external format of the tuple <span class="code">{'$gen_call', {Pid, Ref}, X}</span> where <span class="code">X</span> is not yet filled in.</p> <p>In generated client code this function is the first to be called in the encoding function for each twoway operation.</p> </p></div> <p><a name="oe_send_request_and_receive_reply"><span class="bold_code">int oe_send_request_and_receive_reply(CORBA_Environment *env)</span></a><br><a name="oe_send_request_and_receive_reply_tmo"><span class="bold_code">int oe_send_request_and_receive_reply_tmo(CORBA_Environment *env, unsigned int send_ms, unsigned int recv_ms)</span></a><br></p> <div class="REFBODY"><p> <p>Sends a client request and receives the reply according to the Erlang distribution + gen_server protocol. This function calls the <span class="code">oe_prepare_reply_decoding</span> function in order to obtain the gen_server reply. </p> <p><span class="code">send_ms</span> and <span class="code">recv_ms</span> specify timeouts for send and receive, respectively, in milliseconds.</p> </p></div> <p><a name="oe_prepare_reply_decoding"><span class="bold_code">int oe_prepare_reply_decoding(CORBA_Environment *env)</span></a><br></p> <div class="REFBODY"><p> <p>Decodes the binary version of the tuple <span class="code">{Ref, X}</span>, where <span class="code">X</span> is to be decoded later by the specific client decoding function.</p> </p></div> <h3><a name="id268633">Server Protocol Functions</a></h3> <div class="REFBODY"> <p>The following functions are used internally by generated C server code.</p> </div> <h3>EXPORTS</h3> <p><a name="oe_prepare_request_decoding"><span class="bold_code">int oe_prepare_request_decoding(CORBA_Environment *env)</span></a><br></p> <div class="REFBODY"><p> <p>Decodes the binary version of the tuple <span class="code">{'$gen_cast', Op}</span> (<span class="code">Op</span> an atom), or the tuple <span class="code">{'$gen_cast', {Op, X}}</span>, where <span class="code">Op</span> is the operation name, and where <span class="code">X</span> is to be decoded later by the specific operation decoding function; or</p> <p>decodes the binary version of the tuple <span class="code">{'$gen_call', {Pid, Ref}, Op}</span> (<span class="code">Op</span> an atom), or the tuple <span class="code">{'$gen_call', {Pid, Ref}, {Op, X}}</span>, where <span class="code">Op></span> is the operation name, and <span class="code">X</span> is to be decode later by the specific operation decoding function.</p> </p></div> <p><a name="oe_prepare_reply_encoding"><span class="bold_code">int oe_prepare_reply_encoding(CORBA_Environment *env)</span></a><br></p> <div class="REFBODY"><p> <p>Encodes the beginning of the binary version of the tuple <span class="code">{{Ref,X}</span>, where <span class="code">X</span> is to be filled in by the specific server encoding function.</p> </p></div> <h3><a name="id268741">SEE ALSO</a></h3> <div class="REFBODY"> <p>ic(3), ic_clib(3), <span class="bold_code"><a href="ch_ic_protocol.html">IC Protocol</a></span></p> </div> </div> <div class="footer"> <hr> <p>Copyright © 1998-2011 Ericsson AB. All Rights Reserved.</p> </div> </div> </div></body> </html>