Skip to content

How do I tell Aeron which port to use?


You want an Aeron subscription to receive data on a particular UDP port.


Specify the host and port to listen on in the Aeron channel definition.


Given a configured Aeron object, you can define the listening host and port on a subscription calling the addSubscription method with the desired channel configuration:

Subscription subscription 
    = aeron.addSubscription("aeron:udp?endpoint=", 1);

The example above has a channel configuration of aeron:udp?endpoint= This tells Aeron to construct a UDP channel, with the host set to and port 12345. Note you cannot bind subscriptions to remote hosts, and you cannot use ports already in use.

See Also

Back to top