Class SimpleUDPServer


  • public class SimpleUDPServer
    extends java.lang.Object
    • Constructor Detail

      • SimpleUDPServer

        public SimpleUDPServer()
    • Method Detail

      • onInit

        public void onInit()

        onInit

      • startServer

        public void startServer()
                         throws java.io.IOException

        startServer

        Throws:
        java.lang.Exception - if any.
        java.io.IOException
      • stopServer

        public void stopServer()
                        throws java.io.IOException

        stopServer

        Throws:
        java.io.IOException - if any.
      • getRunnable

        public SimpleServerRunnable getRunnable()
                                         throws java.io.IOException

        getRunnable

        Returns:
        a Runnable object.
        Throws:
        java.lang.Exception - if any.
        java.io.IOException
      • setPort

        public void setPort​(int port)

        setPort

        Parameters:
        port - a int.
      • getPort

        public int getPort()

        getPort

        Returns:
        a int.
      • setTimeout

        public void setTimeout​(int timeout)

        setTimeout

        Parameters:
        timeout - a int.
      • getTimeout

        public int getTimeout()

        getTimeout

        Returns:
        a int.
      • attemptConversation

        protected boolean attemptConversation​(java.net.DatagramSocket socket)
                                       throws java.io.IOException

        attemptConversation

        Parameters:
        socket - a DatagramSocket object.
        Returns:
        a boolean.
        Throws:
        java.io.IOException - if any.
      • addRequestResponse

        protected void addRequestResponse​(java.net.DatagramPacket request,
                                          byte[] response)

        addRequestResponse

        Parameters:
        request - a DatagramPacket object.
        response - an array of byte.
      • setInetAddress

        public void setInetAddress​(java.net.InetAddress testInetAddress)

        setInetAddress

        Parameters:
        testInetAddress - a InetAddress object.
      • getInetAddress

        public java.net.InetAddress getInetAddress()

        getInetAddress

        Returns:
        a InetAddress object.