public class MsgRecvCommFile extends java.lang.Object implements InterProcessComm
| Modifier and Type | Field and Description |
|---|---|
private java.io.File |
fileMsgBin
The only one file which is checked.
|
(package private) long |
lastTimestamp |
receiverShouldbeBlocking, receiverShouldbePolling, version| Constructor and Description |
|---|
MsgRecvCommFile(java.lang.String file) |
| Modifier and Type | Method and Description |
|---|---|
int |
abortReceive()
Abort receiving function
|
int |
capacityToSendWithoutBlocking(int nrofBytesToSend)
Tests wether a next send is done without blocking.
|
int |
checkConnection()
Checks the connection.
|
int |
close()
Closes the mailbox, only to be called on shutdown of the application.
|
Address_InterProcessComm |
createAddress()
Creates an empty instance for a address information, especially for the sender.
|
Address_InterProcessComm |
createAddress(int p1,
int p2) |
Address_InterProcessComm |
createAddress(java.lang.String address) |
Address_InterProcessComm |
createAddress(java.lang.String p1,
int p2) |
int |
dataAvailable()
Tests wether data are available to receive.
|
boolean |
equals(Address_InterProcessComm address1p,
Address_InterProcessComm address2p)
Compare the address to another address, returns true if it is the same address.
|
int |
flush()
Flushs send data to destination.
|
void |
freeData(byte[] data)
Relinguishes the data buffer, after it is evaluated.
|
java.lang.String |
getName() |
Address_InterProcessComm |
getOwnAddress()
Gets the own address of this interProcessComm, it are the receive parameters.
|
byte[] |
getSendBuffer(int len)
Gets a buffer for send.
|
int |
open(Address_InterProcessComm ownAddress,
boolean shouldBlock)
Opens the Communication.
|
byte[] |
receive(int[] result,
Address_InterProcessComm sender)
Receives a Datagram.
|
byte[] |
receiveData(int[] nrofBytes,
byte[] buffer,
Address_InterProcessComm sender) |
int |
send(byte[] data,
int nBytes,
Address_InterProcessComm addressee)
Sends Data.
|
java.lang.String |
translateErrorMsg(int nError) |
private final java.io.File fileMsgBin
long lastTimestamp
public int abortReceive()
InterProcessCommabortReceive in interface InterProcessCommpublic int capacityToSendWithoutBlocking(int nrofBytesToSend)
InterProcessCommcapacityToSendWithoutBlocking in interface InterProcessCommpublic int checkConnection()
InterProcessCommcheckConnection in interface InterProcessCommpublic int close()
InterProcessCommclose in interface InterProcessCommpublic int dataAvailable()
InterProcessCommdataAvailable in interface InterProcessCommpublic boolean equals(Address_InterProcessComm address1p, Address_InterProcessComm address2p)
InterProcessCommequals in interface InterProcessCommpublic int flush()
InterProcessCommflush in interface InterProcessCommpublic void freeData(byte[] data)
InterProcessCommfreeData in interface InterProcessCommdata - The buffer delivered from receive!public java.lang.String getName()
getName in interface InterProcessCommpublic Address_InterProcessComm getOwnAddress()
InterProcessCommgetOwnAddress in interface InterProcessCommpublic byte[] getSendBuffer(int len)
InterProcessCommgetSendBuffer in interface InterProcessCommpublic int open(Address_InterProcessComm ownAddress, boolean shouldBlock)
InterProcessCommopen in interface InterProcessCommownAddress - The own address to which this interprocess-port is assigned.
This address is also used
when calling send() as information about the sender of the data.public byte[] receive(int[] result,
Address_InterProcessComm sender)
InterProcessCommreceive in interface InterProcessCommresult - result[0] = Nr of Bytes sendet, if >=0. If <0 its an error code.sender - Buffer for the sender of the message.public byte[] receiveData(int[] nrofBytes,
byte[] buffer,
Address_InterProcessComm sender)
receiveData in interface InterProcessCommpublic int send(byte[] data,
int nBytes,
Address_InterProcessComm addressee)
InterProcessCommsend in interface InterProcessCommdata - The data to be sent. The user should not touch the buffer after calling here.nBytes - The number of bytes to be send.addressee - The addressee, the receiver of the message. If it is a fix connection (TCP),
then this parameter should be null. It isn't used. The addressee is given
on #open(Address_InterProcessComm, int)-request.public java.lang.String translateErrorMsg(int nError)
translateErrorMsg in interface InterProcessCommpublic Address_InterProcessComm createAddress()
InterProcessCommcreateAddress in interface InterProcessCommpublic Address_InterProcessComm createAddress(int p1, int p2)
createAddress in interface InterProcessCommpublic Address_InterProcessComm createAddress(java.lang.String p1, int p2)
createAddress in interface InterProcessCommpublic Address_InterProcessComm createAddress(java.lang.String address)
createAddress in interface InterProcessComm