Package arc.net
Interface EndPoint
- All Superinterfaces:
Runnable
Represents the local end point of a connection.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(NetListener listener) Adds a listener to the endpoint.void
close()
Returns the last thread that calledupdate(int)
for this end point.void
removeListener
(NetListener listener) void
run()
Continually updates this end point untilstop()
is called.void
start()
Starts a new thread that callsrun()
.void
stop()
Closes this end point and causesrun()
to return.void
update
(int timeout)
-
Method Details
-
addListener
Adds a listener to the endpoint. If the listener already exists, it is not added again. -
removeListener
-
run
void run()Continually updates this end point untilstop()
is called. -
start
void start()Starts a new thread that callsrun()
. -
stop
void stop()Closes this end point and causesrun()
to return. -
close
void close() -
update
- Throws:
IOException
- See Also:
-
getUpdateThread
Thread getUpdateThread()Returns the last thread that calledupdate(int)
for this end point. This can be useful to detect when long running code will be run on the update thread.
-