Listener: Listener
This is used for creating the UDP server endpoints. A UDP server endpoint
is capable of responding to remote callers. The udp:Listener
is
responsible for initializing the endpoint using the provided
configurations.
Constructor
Initializes the UDP listener based on the privovided configurations.
1 listener Listener|error? udpServer = new (8080);
init (int localPort, *ListenerConfiguration config)
- localPort int
The port number of the remote service
- config *ListenerConfiguration
Configurations related to the
udp:Listener
LifeCycle Methods
attach | Binds a service to the |
Methods
'start | Starts the registered service programmatically. |
gracefulStop | Stops the service listener gracefully. |
immediateStop | Stops the service listener immediately. |
detach | Stops consuming messages and detaches the service from the |
attach
Isolated Function
Binds a service to the udp:Listener
.
1udp:error? result = udpListener.attach(helloService);
detach
Isolated Function
Stops consuming messages and detaches the service from the udp:Listener
.
1udp:error? result = udpListener.detach(helloService);
Parameters
- s Service
Type descriptor of the service