Codemesh Runtime v3 C++ API Reference
3.9.205
|
Defines the interface that xmog_jvm uses to communicate with a server. More...
#include <xmog_i_comm_strategy.h>
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 |
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.
|
pure virtual |
Connect to a peer identified by dest.
dest | The address of the peer. Derived classes determine what form this should be in. |
0 | for success |
-1 | for failure. |
Implemented in xmog_i_comm_tcp.
|
pure virtual |
Disconnect from the peer.
Implemented in xmog_i_comm_tcp.
|
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.
|
pure virtual |
Receive data into the specified ACE_Message_Block from the peer.
b | ACE_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. |
0 | Success. |
-1 | Failure. |
Implemented in xmog_i_comm_tcp.
|
pure virtual |
Send data in the specified ACE_Message_Block to the peer.
b | ACE_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. |
0 | Success. |
-1 | Failure. |
Implemented in xmog_i_comm_tcp.