Class UdpKernel.HostThread

java.lang.Object
java.lang.Thread
com.jme3.network.kernel.udp.UdpKernel.HostThread
All Implemented Interfaces:
Runnable
Enclosing class:
UdpKernel

protected class UdpKernel.HostThread extends Thread
Host thread that receives UDP packets for this kernel.
Author:
Paul Speed
  • Constructor Details

    • HostThread

      public HostThread()
      Creates the host thread.
  • Method Details

    • getSocket

      protected DatagramSocket getSocket()
      Returns the datagram socket used by the host thread.
      Returns:
      the datagram socket
    • connect

      public void connect() throws IOException
      Opens and binds the host datagram socket.
      Throws:
      IOException - if the socket cannot be opened
    • close

      public void close() throws IOException, InterruptedException
      Stops the host thread and closes its socket.
      Throws:
      IOException - if socket shutdown fails
      InterruptedException - if interrupted while waiting for shutdown
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread