Erlang -- IC C Protocol Functions

User's Guide
Reference Manual
Release Notes
PDF
Top

ic
Reference Manual
Version 4.2.26

Expand All
Contract All

Table of Contents

- ic
  - Top of manual page
  - ic:gen/1
  - ic:gen/2
- ic_clib
  - Top of manual page
  - CORBA_Environment_alloc()
  - CORBA_free()
  - CORBA_string_alloc()
  - CORBA_wstring_alloc()
  - CORBA_exception_id()
  - CORBA_exception_value()
  - CORBA_exc_set()
  - oe_server_receive()
  - oe_server_receive_tmo()
  - oe_exec_switch()
  - oe_merge_maps()
- ic_c_protocol
  - Top of manual page
  - oe_prepare_notification_encoding()
  - oe_send_notification()
  - oe_send_notification_tmo()
  - oe_prepare_request_encoding()
  - oe_send_request_and_receive_reply()
  - oe_send_request_and_receive_reply_tmo()
  - oe_prepare_reply_decoding()
  - oe_prepare_request_decoding()
  - oe_prepare_reply_encoding()

# ic_c_protocol

### C LIBRARY

ic_c_protocol

### LIBRARY SUMMARY

IC C Protocol Functions

### DESCRIPTION

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.

### EXPORTS

int oe_prepare_notification_encoding(CORBA_Environment *env)

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.

int oe_send_notification(CORBA_Environment *env)
int oe_send_notification_tmo(CORBA_Environment *env, unsigned int send_ms)

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

The send_ms parameter specified a timeout in milliseconds.

int oe_prepare_request_encoding(CORBA_Environment *env)

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.

int oe_send_request_and_receive_reply(CORBA_Environment *env)
int oe_send_request_and_receive_reply_tmo(CORBA_Environment *env, unsigned int send_ms, unsigned int recv_ms)

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.

int oe_prepare_reply_decoding(CORBA_Environment *env)

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.

### EXPORTS

int oe_prepare_request_decoding(CORBA_Environment *env)

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.

int oe_prepare_reply_encoding(CORBA_Environment *env)

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