Class EIEIOConnection
java.lang.Object
uk.ac.manchester.spinnaker.connections.UDPConnection<EIEIOMessage<? extends EIEIOHeader>>
uk.ac.manchester.spinnaker.connections.EIEIOConnection
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Connection
A UDP connection for sending and receiving raw EIEIO messages.
- 
Nested Class SummaryNested classes/interfaces inherited from class uk.ac.manchester.spinnaker.connections.UDPConnectionUDPConnection.TrafficClass
- 
Constructor SummaryConstructorsConstructorDescriptionEIEIOConnection(InetAddress localHost, Integer localPort) Create an EIEIO connection only available for listening.
- 
Method SummaryModifier and TypeMethodDescriptionprotected EIEIOCommandReceive a raw command.EIEIOMessage<? extends EIEIOHeader>receiveMessage(int timeout) Receives a SpiNNaker message from this connection.protected voidsendCommand(int command) Send a raw command.protected voidsendCommand(EIEIOCommand command) Send a raw command.protected voidsendCommand(EIEIOCommand command, InetAddress ipAddress, int port) Send a raw command.voidsendEIEIOMessage(EIEIOMessage<?> eieioMessage) Sends an EIEIO message down this connection.voidsendEIEIOMessageTo(EIEIOMessage<? extends EIEIOHeader> eieioMessage, InetAddress ipAddress, int port) Send an EIEIO message to a specific destination.Methods inherited from class uk.ac.manchester.spinnaker.connections.UDPConnectionclose, doReceive, doReceiveWithAddress, doSend, doSendTo, getLocalAddress, getLocalIPAddress, getLocalPort, getRemoteAddress, getRemoteIPAddress, getRemotePort, isClosed, isConnected, receive, receive, receiveMessage, receiveWithAddress, send, send, sendPortTriggerMessage, sendTo, sendTo, sendTo, setInUse, setNotInUse, setReceivePacketSize, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface uk.ac.manchester.spinnaker.connections.model.ConnectionconvertTimeout
- 
Constructor Details- 
EIEIOConnectionCreate an EIEIO connection only available for listening.- Parameters:
- localHost- The local IP address to bind to. If not specified, it defaults to binding 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, 0 or between 1025 and 65535.
- Throws:
- IOException- If there is an error setting up the communication channel
 
 
- 
- 
Method Details- 
sendEIEIOMessageSends an EIEIO message down this connection.- Parameters:
- eieioMessage- The EIEIO message to be sent
- Throws:
- IOException- If there is an error sending the message
 
- 
sendCommandSend a raw command.- Parameters:
- command- The command to send.
- Throws:
- IOException- If sending fails.
 
- 
sendCommandSend a raw command.- Parameters:
- command- The command to send.
- Throws:
- IOException- If sending fails.
 
- 
sendCommandprotected void sendCommand(EIEIOCommand command, InetAddress ipAddress, int port) throws IOException Send a raw command.- Parameters:
- command- The command to send.
- ipAddress- The host to send to.
- port- The port to send to.
- Throws:
- IOException- If sending fails.
 
- 
receiveCommandReceive a raw command.- Returns:
- the command ID
- Throws:
- IOException- If receiving fails.
- InterruptedException- If communications are interrupted.
 
- 
sendEIEIOMessageTopublic void sendEIEIOMessageTo(EIEIOMessage<? extends EIEIOHeader> eieioMessage, InetAddress ipAddress, int port) throws IOException Send an EIEIO message to a specific destination.- Parameters:
- eieioMessage- The message to send.
- ipAddress- The host to send to.
- port- The port to send to.
- Throws:
- IOException- If anything goes wrong in sending.
 
- 
receiveMessagepublic EIEIOMessage<? extends EIEIOHeader> receiveMessage(int timeout) throws IOException, InterruptedException Description copied from class:UDPConnectionReceives a SpiNNaker message from this connection. Blocks until a message has been received, or a timeout occurs.- Specified by:
- receiveMessagein class- UDPConnection<EIEIOMessage<? extends EIEIOHeader>>
- 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.
 
 
-