2004 2007 Ericsson AB, All Rights Reserved The contents of this file are subject to the Erlang Public License, Version 1.1, (the "License"); you may not use this file except in compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Initial Developer of the Original Code is Ericsson AB. IC C Protocol Functions 2004-04-06 A
ic_c_protocol IC C Protocol Functions

This manual page lists some of the functions of the IC C runtime library that are used internally for the IC protocol.

The listed functions are used internally by generated C client and server code. They are documented here for the advanced user 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 oe, the user has to implement his own set of functions, the names of which are obtained by replacing the oe prefix by Prefix. The Prefix has to be set with the option {user_protocol, Prefix} at compile time.

The following terminology is used (reflected in names of functions): a notification is a message send from client to server, without any reply back (i.e. a oneway operation); a request is a message sent from client to server, and where a reply message is sent back from the server to the client.

In order to understand how the functions work and what they do the user must study their implementation in the IC C library (source file is ic.c), and also consider how they are used in the C code of ordinary generated client stubs or server skeletons.

Client Protocol Functions

The following functions are used internally by generated C client code.

intoe_prepare_notification_encoding(CORBA_Environment *env) Prepare client notification encoding.

The result of this function is the beginning of a binary of in external format of the tuple {'$gen_cast', X} where X is not yet filled in.

In generated client code this function is the first to be called in the encoding function for each oneway operation.

intoe_send_notification(CORBA_Environment *env) intoe_send_notification_tmo(CORBA_Environment *env, unsigned int send_ms) Send client notification.

Sends a client notification to a server according to the Erlang distribution + gen_server protocol.

The send_ms parameter specified a timeout in milliseconds.

intoe_prepare_request_encoding(CORBA_Environment *env) Prepare client request encoding.

The result of this function is the beginning of a binary in the external format of the tuple {'$gen_call', {Pid, Ref}, X} where X is not yet filled in.

In generated client code this function is the first to be called in the encoding function for each twoway operation.

intoe_send_request_and_receive_reply(CORBA_Environment *env) intoe_send_request_and_receive_reply_tmo(CORBA_Environment *env, unsigned int send_ms, unsigned int recv_ms) Send client request and receive reply.

Sends a client request and receives the reply according to the Erlang distribution + gen_server protocol. This function calls the oe_prepare_reply_decoding function in order to obtain the gen_server reply.

send_ms and recv_ms specify timeouts for send and receive, respectively, in milliseconds.

intoe_prepare_reply_decoding(CORBA_Environment *env) Prepare client decoding of reply.

Decodes the binary version of the tuple {Ref, X}, where X is to be decoded later by the specific client decoding function.

Server Protocol Functions

The following functions are used internally by generated C server code.

intoe_prepare_request_decoding(CORBA_Environment *env) Prepare server decoding of request.

Decodes the binary version of the tuple {'$gen_cast', Op} (Op an atom), or the tuple {'$gen_cast', {Op, X}}, where Op is the operation name, and where X is to be decoded later by the specific operation decoding function; or

decodes the binary version of the tuple {'$gen_call', {Pid, Ref}, Op} (Op an atom), or the tuple {'$gen_call', {Pid, Ref}, {Op, X}}, where Op> is the operation name, and X is to be decode later by the specific operation decoding function.

intoe_prepare_reply_encoding(CORBA_Environment *env) Prepare server encoding of reply.

Encodes the beginning of the binary version of the tuple {{Ref,X}, where X is to be filled in by the specific server encoding function.

SEE ALSO

ic(3), ic_clib(3), IC Protocol