com.esotericsoftware.kryonet
Interface EndPoint

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
Client, Server

public interface EndPoint
extends java.lang.Runnable

Represents the local end point of a connection.

Author:
Nathan Sweet

Method Summary
 void addListener(Listener listener)
          If the listener already exists, it is not added again.
 void close()
           
 com.esotericsoftware.kryo.Kryo getKryo()
          Gets the Kryo instance that will be used to serialize and deserialize objects.
 java.lang.Thread getUpdateThread()
          Returns the last thread that called update(int) for this end point.
 void removeListener(Listener listener)
           
 void run()
          Continually updates this end point until stop() is called.
 void start()
          Starts a new thread that calls run().
 void stop()
          Closes this end point and causes run() to return.
 void update(int timeout)
           
 

Method Detail

getKryo

com.esotericsoftware.kryo.Kryo getKryo()
Gets the Kryo instance that will be used to serialize and deserialize objects.


addListener

void addListener(Listener listener)
If the listener already exists, it is not added again.


removeListener

void removeListener(Listener listener)

run

void run()
Continually updates this end point until stop() is called.

Specified by:
run in interface java.lang.Runnable

start

void start()
Starts a new thread that calls run().


stop

void stop()
Closes this end point and causes run() to return.


close

void close()
See Also:
Client, Server

update

void update(int timeout)
            throws java.io.IOException
Throws:
java.io.IOException
See Also:
Client.update(int), Server.update(int)

getUpdateThread

java.lang.Thread getUpdateThread()
Returns the last thread that called update(int) for this end point. This can be useful to detect when long running code will be run on the update thread.