1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
<TITLE>IC C Protocol Functions</TITLE>
<SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
<STYLE TYPE="text/css">
<!--
.REFBODY { margin-left: 13mm }
.REFTYPES { margin-left: 8mm }
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
<IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>IC C Protocol Functions</H1>
</CENTER>
<H3>C LIBRARY</H3>
<DIV CLASS=REFBODY>
ic_c_protocol
</DIV>
<H3>C LIBRARY SUMMARY</H3>
<DIV CLASS=REFBODY>
IC C Protocol Functions
</DIV>
<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>
<P> This manual page lists some of the functions of the IC C runtime
library that are used internally for the IC protocol.
<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 <CODE>oe</CODE>, the user
has to implement his own set of functions, the names of which
are obtained by replacing the <CODE>oe</CODE> prefix by <CODE>Prefix</CODE>.
The <CODE>Prefix</CODE> has to be set with the option
<CODE>{user_protocol, Prefix}</CODE> at compile time.
<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> 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 <CODE>ic.c</CODE>), and also consider how they
are used in the C code of ordinary generated client stubs or
server skeletons.
<P>
</DIV>
<H3>Client Protocol Functions</H3>
<DIV CLASS=REFBODY>
<P> The following functions are used internally by generated C
client code.
</DIV>
<H3>EXPORTS</H3>
<P><A NAME="oe_prepare_notification_encoding/1"><STRONG><CODE>int
oe_prepare_notification_encoding(CORBA_Environment *env)
</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P> The result of this function is the beginning of a binary of
in external format of the tuple <CODE>{'$gen_cast', X}</CODE> where
<CODE>X</CODE> is not yet filled in.
<P> In generated client code this function is the first to be called
in the encoding function for each oneway operation.
</DIV>
<P><A NAME="oe_send_notification/1"><STRONG><CODE>int oe_send_notification(CORBA_Environment *env)
</CODE></STRONG></A><BR>
<A NAME="oe_send_notification_tmo/2"><STRONG><CODE>int oe_send_notification_tmo(CORBA_Environment *env,
unsigned int send_ms)
</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P> Sends a client notification to a server according to the
Erlang distribution + gen_server protocol.
<P> The <CODE>send_ms</CODE> parameter specified a timeout in milliseconds.
</DIV>
<P><A NAME="oe_prepare_request_encoding/1"><STRONG><CODE>int
oe_prepare_request_encoding(CORBA_Environment *env)
</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P> The result of this function is the beginning of a binary in
the external format of the tuple <CODE>{'$gen_call', {Pid,
Ref}, X}</CODE> where <CODE>X</CODE> is not yet filled in.
<P> In generated client code this function is the first to be called
in the encoding function for each twoway operation.
</DIV>
<P><A NAME="oe_send_request_and_receive_reply/1"><STRONG><CODE>int
oe_send_request_and_receive_reply(CORBA_Environment *env)
</CODE></STRONG></A><BR>
<A NAME="oe_send_request_and_receive_reply_tmo/3"><STRONG><CODE>int
oe_send_request_and_receive_reply_tmo(CORBA_Environment *env,
unsigned int send_ms, unsigned int recv_ms)
</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P>Sends a client request and receives the reply according to
the Erlang distribution + gen_server protocol. This function
calls the <CODE>oe_prepare_reply_decoding</CODE> function in order
to obtain the gen_server reply.
<P><CODE>send_ms</CODE> and <CODE>recv_ms</CODE> specify timeouts for send
and receive, respectively, in milliseconds.
</DIV>
<P><A NAME="oe_prepare_reply_decoding/1"><STRONG><CODE>int
oe_prepare_reply_decoding(CORBA_Environment *env)
</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P>Decodes the binary version of the tuple <CODE>{Ref, X}</CODE>,
where <CODE>X</CODE> is to be decoded later by the specific client
decoding function.
</DIV>
<H3>Server Protocol Functions</H3>
<DIV CLASS=REFBODY>
<P> The following functions are used internally by generated C
server code.
</DIV>
<H3>EXPORTS</H3>
<P><A NAME="oe_prepare_request_decoding/1"><STRONG><CODE>int
oe_prepare_request_decoding(CORBA_Environment *env)
</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P> Decodes the binary version of the tuple <CODE>{'$gen_cast',
Op}</CODE> (<CODE>Op</CODE> an atom), or the tuple <CODE>{'$gen_cast',
{Op, X}}</CODE>, where <CODE>Op</CODE> is the operation name, and
where <CODE>X</CODE> is to be decoded later by the specific
operation decoding function; or
<P> decodes the binary version of the tuple <CODE>{'$gen_call',
{Pid, Ref}, Op}</CODE> (<CODE>Op</CODE> an atom), or the tuple
<CODE>{'$gen_call', {Pid, Ref}, {Op, X}}</CODE>, where <CODE>Op></CODE>
is the operation name, and <CODE>X</CODE> is to be decode later by
the specific operation decoding function.
</DIV>
<P><A NAME="oe_prepare_reply_encoding/1"><STRONG><CODE>int oe_prepare_reply_encoding(CORBA_Environment
*env)
</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P> Encodes the beginning of the binary version of the tuple
<CODE>{{Ref,X}</CODE>, where <CODE>X</CODE> is to be filled in by the
specific server encoding function.
</DIV>
<H3>SEE ALSO</H3>
<DIV CLASS=REFBODY>
<P> ic(3), ic_clib(3), <A HREF="ch_ic_protocol.html">IC Protocol</A>
</DIV>
<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Peter Hfeldt - support@erlang.ericsson.se<BR>
</DIV>
<CENTER>
<HR>
<SMALL>ic 4.2.11<BR>
Copyright © 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>
|