public class UdpListenerConnection extends AbstractUdpConnection implements ListenerConnection
objectSerializer, socket, socketPropertiesconnectionSettings, LOGGER, wasDisconnected| Constructor and Description |
|---|
UdpListenerConnection(SocketConnectionSettings connectionSettings,
UdpSocketProperties socketProperties) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Establish a connection ready to be used.
|
SocketWorker |
listen(org.mule.runtime.extension.api.runtime.source.SourceCallback<InputStream,SocketAttributes> sourceCallback)
One worker is created per received package.
|
doDisconnect, newSocket, validatedisconnectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisconnect, validatepublic UdpListenerConnection(SocketConnectionSettings connectionSettings, UdpSocketProperties socketProperties) throws org.mule.runtime.api.connection.ConnectionException
org.mule.runtime.api.connection.ConnectionExceptionpublic void connect()
throws org.mule.runtime.api.connection.ConnectionException
SocketConnectionconnect in interface SocketConnectionorg.mule.runtime.api.connection.ConnectionException - if the connection couldn't be establishedpublic SocketWorker listen(org.mule.runtime.extension.api.runtime.source.SourceCallback<InputStream,SocketAttributes> sourceCallback) throws IOException, org.mule.runtime.api.connection.ConnectionException
DatagramSocket
bound to a port choose by the system.
The new DatagramSocket used for responding has the same configuration settings than the listener socket used in the
Source.
listen in interface ListenerConnectionsourceCallback - used in the SocketWorker to deliver the new received messagesRunnable that will represent a new received connection. The Runnable should be scheduled with an
Executor in it's own thread.ReadingTimeoutException - if the socket reached timeout while awaiting the arrival of a new package.org.mule.runtime.api.connection.ConnectionException - if the socket was close while blocked on DatagramSocket.receive(DatagramPacket) method
and the close was not intentionally done by the AbstractSocketConnection.disconnect() method.IOException - if the socket was close while blocked on DatagramSocket.receive(DatagramPacket) method.Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.