Package org.zeromq
Class ZAgent.SimpleAgent
- java.lang.Object
-
- org.zeromq.ZAgent.SimpleAgent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.zeromq.ZAgent
ZAgent.Creator, ZAgent.SelectorCreator, ZAgent.SimpleAgent
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
lock
private boolean
locked
private ZMQ.Socket
pipe
-
Constructor Summary
Constructors Constructor Description SimpleAgent(ZMQ.Socket pipe, java.lang.String lock)
Creates a new simple agent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the pipe.ZMQ.Socket
pipe()
Returns the socket used for communication.ZMsg
recv()
Receives a control message sent from the Plateau in the Corbeille.ZMsg
recv(boolean wait)
Receives a control message sent from the Plateau in the Corbeille.ZMsg
recv(int timeout)
Receives a control message sent from the Plateau in the Corbeille.boolean
send(java.lang.String word)
Sends a control message from the Corbeille to the Plateau side.boolean
send(java.lang.String word, boolean more)
Sends a control message from the Corbeille to the Plateau side.boolean
send(ZMsg message)
Sends a control message from the Corbeille to the Plateau.boolean
send(ZMsg msg, boolean destroy)
Sends a control message from Corbeille side to the Plateau side.boolean
sign()
Gives a sign if the distant Star is here.
-
-
-
Field Detail
-
pipe
private final ZMQ.Socket pipe
-
lock
private final byte[] lock
-
locked
private boolean locked
-
-
Constructor Detail
-
SimpleAgent
public SimpleAgent(ZMQ.Socket pipe, java.lang.String lock)
Creates a new simple agent.- Parameters:
pipe
- the pipe used to send control messages to the distant IStar.lock
- the lock to use. If null, the locking mechanism is omitted.
-
-
Method Detail
-
sign
public boolean sign()
Description copied from interface:ZAgent
Gives a sign if the distant Star is here.
-
close
public void close()
Description copied from interface:ZAgent
Closes the pipe.
-
recv
public ZMsg recv()
Description copied from interface:ZAgent
Receives a control message sent from the Plateau in the Corbeille. The call is blocking.
-
recv
public ZMsg recv(int timeout)
Description copied from interface:ZAgent
Receives a control message sent from the Plateau in the Corbeille. The call times out if there is no message after the elapsed time.
-
recv
public ZMsg recv(boolean wait)
Description copied from interface:ZAgent
Receives a control message sent from the Plateau in the Corbeille. The call is blocking depending on the parameter.
-
send
public boolean send(ZMsg message)
Description copied from interface:ZAgent
Sends a control message from the Corbeille to the Plateau.
-
send
public boolean send(java.lang.String word)
Description copied from interface:ZAgent
Sends a control message from the Corbeille to the Plateau side.
-
send
public boolean send(java.lang.String word, boolean more)
Description copied from interface:ZAgent
Sends a control message from the Corbeille to the Plateau side.
-
send
public boolean send(ZMsg msg, boolean destroy)
Description copied from interface:ZAgent
Sends a control message from Corbeille side to the Plateau side.
-
pipe
public ZMQ.Socket pipe()
Description copied from interface:ZAgent
Returns the socket used for communication. For advanced usage.
-
-