Class IPAddressConnection
java.lang.Object
uk.ac.manchester.spinnaker.connections.UDPConnection<InetAddress>
uk.ac.manchester.spinnaker.connections.IPAddressConnection
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Connection
public class IPAddressConnection extends UDPConnection<InetAddress>
A connection that detects any UDP packet that is transmitted by SpiNNaker
boards prior to boot. Note that pre-boot messages contain no useful payload.
-
Nested Class Summary
Nested classes/interfaces inherited from class uk.ac.manchester.spinnaker.connections.UDPConnection
UDPConnection.TrafficClass
-
Constructor Summary
Constructors Constructor Description IPAddressConnection()
Create a connection listening on the default SpiNNaker pre-boot broadcast port.IPAddressConnection(InetAddress localHost)
Create a connection listening on the default SpiNNaker pre-boot broadcast port.IPAddressConnection(InetAddress localHost, int localPort)
Create a connection. -
Method Summary
Modifier and Type Method Description InetAddress
receiveMessage()
Receives a SpiNNaker message from this connection.InetAddress
receiveMessage(int timeout)
Receives a SpiNNaker message from this connection.Methods inherited from class uk.ac.manchester.spinnaker.connections.UDPConnection
close, doReceive, doReceiveWithAddress, doSend, doSendTo, getLocalAddress, getLocalIPAddress, getLocalPort, getRemoteAddress, getRemoteIPAddress, getRemotePort, isClosed, isConnected, receive, receive, receiveWithAddress, send, send, sendPortTriggerMessage, sendTo, sendTo, sendTo, setReceivePacketSize, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface uk.ac.manchester.spinnaker.connections.model.Connection
convertTimeout
-
Constructor Details
-
IPAddressConnection
Create a connection listening on the default SpiNNaker pre-boot broadcast port.- Throws:
IOException
- If setting up the network fails.
-
IPAddressConnection
Create a connection listening on the default SpiNNaker pre-boot broadcast port.- Parameters:
localHost
- Local hostname to bind to.- Throws:
IOException
- If setting up the network fails.
-
IPAddressConnection
Create a connection.- Parameters:
localHost
- Local hostname to bind to.localPort
- Local port to bind to.- Throws:
IOException
- If setting up the network fails.
-
-
Method Details
-
receiveMessage
Description copied from class:UDPConnection
Receives a SpiNNaker message from this connection. Blocks until a message has been received.- Overrides:
receiveMessage
in classUDPConnection<InetAddress>
- Returns:
- The IP address, or
null
if none was forthcoming.
-
receiveMessage
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 classUDPConnection<InetAddress>
- Parameters:
timeout
- How long to wait for an IP address;null
for forever.- Returns:
- The IP address, or
null
if none was forthcoming.
-