com.stc.connector.tcpip.ext.msg
Class CustomEnvelopedMsgSample01
java.lang.Object
com.stc.connector.tcpip.ext.msg.CustomEnvelopedMsgSample01
- All Implemented Interfaces:
- EnvelopedMsgReceiver, EnvelopedMsgSender
public class CustomEnvelopedMsgSample01
- extends java.lang.Object
- implements EnvelopedMsgReceiver, EnvelopedMsgSender
A custom envelope message sample:
Read data on socket from position "offset" until length "len".
The "offset" and "len" are defauled as 4 and 10.
Note: This sample is only used to demonstrate the extensibility of envelope type.
You can define your configuration parameters on your demand (for excample,
you can make "offset" and "len" configurable).
- Version:
- cvs revision: $Revision: 1.8 $ Last Modified: $Date: 2008/02/29 09:01:28 $
- Author:
- Harry Liu
Field Summary |
static java.lang.String |
version
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
version
public static final java.lang.String version
- See Also:
- Constant Field Values
CustomEnvelopedMsgSample01
public CustomEnvelopedMsgSample01()
- Constructor for CustomEnvelopedMsgSample01.
receiveEnvelopedMsg
public EnvelopedMsg receiveEnvelopedMsg(TCPIPEXTClientApplication app)
throws TCPIPApplicationException,
java.io.IOException
- Description copied from interface:
EnvelopedMsgReceiver
- Receives an EnvelopedMsg.
- Specified by:
receiveEnvelopedMsg
in interface EnvelopedMsgReceiver
- Parameters:
app
- TCPIPEXTClientApplication
- Returns:
- EnvelopedMsg instance
- Throws:
TCPIPApplicationException
- on error
java.io.IOException
- on i/o error- See Also:
(TCPIPEXTClientApplication)
sendEnvelopedMsg
public void sendEnvelopedMsg(EnvelopedMsg msg,
TCPIPEXTClientApplication app)
throws TCPIPApplicationException,
java.io.IOException
- Description copied from interface:
EnvelopedMsgSender
- Sends an EnvelopedMsg.
- Specified by:
sendEnvelopedMsg
in interface EnvelopedMsgSender
- Parameters:
msg
- EnvelopedMsg instanceapp
- TCPIPEXTClientApplication
- Throws:
TCPIPApplicationException
- on error
java.io.IOException
- on i/o error- See Also:
(EnvelopedMsg, TCPIPEXTClientApplication)