Codemesh Runtime v3 C++ API Reference  3.9.205
Public Member Functions | List of all members
xmog_i_comm_strategy Class Referenceabstract

Defines the interface that xmog_jvm uses to communicate with a server. More...

#include <xmog_i_comm_strategy.h>

Inheritance diagram for xmog_i_comm_strategy:
Inheritance graph
[legend]

Public Member Functions

virtual int connect (const ACE_TCHAR *dest, const ACE_Time_Value *timeout=0)=0
 
virtual void disconnect (void)=0
 
virtual int send (ACE_Message_Block &b)=0
 
virtual int recv (ACE_Message_Block &b)=0
 
virtual ACE_HANDLE get_handle (void)=0
 

Detailed Description

Defines the interface that xmog_jvm uses to communicate with a server.

The lack of uniformity between connector/stream pairs among the possible IPC types that xmog may want to use (TCP, UDP, UNIX pipe, MEM_Stream, etc.) make a strategy the best way to approach this. Since there is a limited number of operations that xmog_jvm needs to take advantage of, it's easier to encapsulate them behind a strategy than to try to ifdef things elsewhere. This class defines an interface which other strategy classes representing the actual IPC mechanisms need to inherit from.

Member Function Documentation

◆ connect()

virtual int xmog_i_comm_strategy::connect ( const ACE_TCHAR *  dest,
const ACE_Time_Value *  timeout = 0 
)
pure virtual

Connect to a peer identified by dest.

Parameters
destThe address of the peer. Derived classes determine what form this should be in.
Return values
0for success
-1for failure.

Implemented in xmog_i_comm_tcp.

◆ disconnect()

virtual void xmog_i_comm_strategy::disconnect ( void  )
pure virtual

Disconnect from the peer.

Implemented in xmog_i_comm_tcp.

◆ get_handle()

virtual ACE_HANDLE xmog_i_comm_strategy::get_handle ( void  )
pure virtual

Obtain the IPC handle for this strategy. This is a handle that can be registered with an ACE_Reactor for INPUT, OUTPUT events.

Implemented in xmog_i_comm_tcp.

◆ recv()

virtual int xmog_i_comm_strategy::recv ( ACE_Message_Block &  b)
pure virtual

Receive data into the specified ACE_Message_Block from the peer.

Parameters
bACE_Message_Block to store data. Data is placed starting at the block's wr_ptr. b.space() is used to get the max amount of data to receive. wr_ptr is updated to reflect received data.
Return values
0Success.
-1Failure.

Implemented in xmog_i_comm_tcp.

◆ send()

virtual int xmog_i_comm_strategy::send ( ACE_Message_Block &  b)
pure virtual

Send data in the specified ACE_Message_Block to the peer.

Parameters
bACE_Message_Block to send. Data is sent starting at the block's rd_ptr. b.length() is used to get the amount of data to send. rd_ptr is updated to reflect sent data.
Return values
0Success.
-1Failure.

Implemented in xmog_i_comm_tcp.


The documentation for this class was generated from the following file:

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.