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()
InterProcessComm
abortReceive
in interface InterProcessComm
public int capacityToSendWithoutBlocking(int nrofBytesToSend)
InterProcessComm
capacityToSendWithoutBlocking
in interface InterProcessComm
public int checkConnection()
InterProcessComm
checkConnection
in interface InterProcessComm
public int close()
InterProcessComm
close
in interface InterProcessComm
public int dataAvailable()
InterProcessComm
dataAvailable
in interface InterProcessComm
public boolean equals(Address_InterProcessComm address1p, Address_InterProcessComm address2p)
InterProcessComm
equals
in interface InterProcessComm
public int flush()
InterProcessComm
flush
in interface InterProcessComm
public void freeData(byte[] data)
InterProcessComm
freeData
in interface InterProcessComm
data
- The buffer delivered from receive!public java.lang.String getName()
getName
in interface InterProcessComm
public Address_InterProcessComm getOwnAddress()
InterProcessComm
getOwnAddress
in interface InterProcessComm
public byte[] getSendBuffer(int len)
InterProcessComm
getSendBuffer
in interface InterProcessComm
public int open(Address_InterProcessComm ownAddress, boolean shouldBlock)
InterProcessComm
open
in interface InterProcessComm
ownAddress
- 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)
InterProcessComm
receive
in interface InterProcessComm
result
- 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 InterProcessComm
public int send(byte[] data, int nBytes, Address_InterProcessComm addressee)
InterProcessComm
send
in interface InterProcessComm
data
- 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 InterProcessComm
public Address_InterProcessComm createAddress()
InterProcessComm
createAddress
in interface InterProcessComm
public Address_InterProcessComm createAddress(int p1, int p2)
createAddress
in interface InterProcessComm
public Address_InterProcessComm createAddress(java.lang.String p1, int p2)
createAddress
in interface InterProcessComm
public Address_InterProcessComm createAddress(java.lang.String address)
createAddress
in interface InterProcessComm