|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMythPacket
This interface represents a protocol packet that can be send over network.
DELIM
and the first 8 bytes of the resulting
byte stream must contain the size of the payload.
The following example shows how a MythTV-packet looks like.
A request packet | |
24 | QUERY_FREE_SPACE_SUMMARY |
A response packet. | |
32 | 0[]:[]18761596[]:[]0[]:[]2985552 |
// convert a sendable object to a packet IMythPacket req = sendableObj.getPacket(); // convert the packet into bytes and send it via the output stream PacketUtils.writeTo(req, socketOutputStream); // read the response packet from input stream IMythPacket resp = PacketUtils.readFrom(protoVersion, socketInputStream);
PacketUtils
class provides convenient methods to read and write a packet.
PacketUtils.writeTo
,
PacketUtils.readFrom
Field Summary | |
---|---|
static String |
DELIM
The delimeter used to separate the packet arguments when sending them over network. |
Method Summary | |
---|---|
String |
getPacketArg(int idx)
Gets the packet argument value at the given position. |
List<String> |
getPacketArgs()
Gets the packet arguments. |
int |
getPacketArgsLength()
Gets the amount of the packet arguments. |
Date |
getPacketCreationTime()
Gets the time when this packet was created. |
Methods inherited from interface org.jmythapi.IVersionable |
---|
getVersionNr |
Field Detail |
---|
static final String DELIM
Method Detail |
---|
List<String> getPacketArgs()
int getPacketArgsLength()
String getPacketArg(int idx)
idx
- the position of the desired argument
Date getPacketCreationTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |