Class BootConnection

java.lang.Object
uk.ac.manchester.spinnaker.connections.UDPConnection<BootMessage>
uk.ac.manchester.spinnaker.connections.BootConnection
All Implemented Interfaces:
Closeable, AutoCloseable, Connection

public class BootConnection extends UDPConnection<BootMessage>
A connection to the SpiNNaker board that uses UDP for booting.
  • Constructor Details

    • BootConnection

      public BootConnection(InetAddress localHost, Integer localPort, InetAddress remoteHost, Integer remotePort) throws IOException
      Creates a boot connection.
      Parameters:
      localHost - The local host to bind to. If null defaults to bind to all interfaces, unless remoteHost is specified, in which case binding is done to the IP address that will be used to send packets.
      localPort - The local port to bind to, between 1025 and 32767. If null, defaults to a random unused local port
      remoteHost - The remote host to send packets to. If null, the socket will be available for listening only, and will throw and exception if used for sending
      remotePort - The remote port to send packets to. If null, a default value is used.
      Throws:
      IOException - If there is an error setting up the communication channel
  • Method Details

    • receiveMessage

      public BootMessage receiveMessage(int timeout) throws IOException, InterruptedException
      Description copied from class: UDPConnection
      Receives a SpiNNaker message from this connection. Blocks until a message has been received, or a timeout occurs.
      Specified by:
      receiveMessage in class UDPConnection<BootMessage>
      Parameters:
      timeout - The time in seconds to wait for the message to arrive, or until the connection is closed.
      Returns:
      the received message
      Throws:
      IOException - If there is an error receiving the message
      SocketTimeoutException - If there is a timeout during receiving
      InterruptedException - If communications are interrupted.
    • sendBootMessage

      public void sendBootMessage(BootMessage bootMessage) throws IOException
      Sends a SpiNNaker boot message using this connection.
      Parameters:
      bootMessage - The message to be sent
      Throws:
      IOException - If there is an error sending the message