Package zmq.io
Class IOObject
- java.lang.Object
-
- zmq.io.IOObject
-
- All Implemented Interfaces:
IPollEvents
public class IOObject extends java.lang.Object implements IPollEvents
-
-
Field Summary
Fields Modifier and Type Field Description private booleanaliveprivate IPollEventshandlerprivate Pollerpoller
-
Constructor Summary
Constructors Constructor Description IOObject(IOThread ioThread, IPollEvents handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptEvent()Called by I/O thread when file descriptor is ready for accept.Poller.HandleaddFd(java.nio.channels.SelectableChannel fd)voidaddTimer(long timeout, int id)voidcancelTimer(int id)voidconnectEvent()Called by I/O thread when file descriptor might be ready for connecting.voidinEvent()Called by I/O thread when file descriptor is ready for reading.voidoutEvent()Called by I/O thread when file descriptor is ready for writing.voidplug()voidremoveHandle(Poller.Handle handle)voidresetPollIn(Poller.Handle handle)voidresetPollOut(Poller.Handle handle)voidsetPollAccept(Poller.Handle handle)voidsetPollConnect(Poller.Handle handle)voidsetPollIn(Poller.Handle handle)voidsetPollOut(Poller.Handle handle)voidtimerEvent(int id)Called when timer expires.java.lang.StringtoString()voidunplug()
-
-
-
Field Detail
-
poller
private final Poller poller
-
handler
private final IPollEvents handler
-
alive
private boolean alive
-
-
Constructor Detail
-
IOObject
public IOObject(IOThread ioThread, IPollEvents handler)
-
-
Method Detail
-
plug
public final void plug()
-
unplug
public final void unplug()
-
addFd
public final Poller.Handle addFd(java.nio.channels.SelectableChannel fd)
-
removeHandle
public final void removeHandle(Poller.Handle handle)
-
setPollIn
public final void setPollIn(Poller.Handle handle)
-
setPollOut
public final void setPollOut(Poller.Handle handle)
-
setPollConnect
public final void setPollConnect(Poller.Handle handle)
-
setPollAccept
public final void setPollAccept(Poller.Handle handle)
-
resetPollIn
public final void resetPollIn(Poller.Handle handle)
-
resetPollOut
public final void resetPollOut(Poller.Handle handle)
-
inEvent
public final void inEvent()
Description copied from interface:IPollEventsCalled by I/O thread when file descriptor is ready for reading.- Specified by:
inEventin interfaceIPollEvents
-
outEvent
public final void outEvent()
Description copied from interface:IPollEventsCalled by I/O thread when file descriptor is ready for writing.- Specified by:
outEventin interfaceIPollEvents
-
connectEvent
public final void connectEvent()
Description copied from interface:IPollEventsCalled by I/O thread when file descriptor might be ready for connecting.- Specified by:
connectEventin interfaceIPollEvents
-
acceptEvent
public final void acceptEvent()
Description copied from interface:IPollEventsCalled by I/O thread when file descriptor is ready for accept.- Specified by:
acceptEventin interfaceIPollEvents
-
timerEvent
public final void timerEvent(int id)
Description copied from interface:IPollEventsCalled when timer expires.- Specified by:
timerEventin interfaceIPollEvents- Parameters:
id- the ID of the expired timer.
-
addTimer
public final void addTimer(long timeout, int id)
-
cancelTimer
public final void cancelTimer(int id)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-