Listener: Listener
This is used for creating TCP server endpoints. A TCP server endpoint is
capable of responding to remote callers. The Listener
is responsible for
initializing the endpoint using the provided configurations.
Constructor
Initializes the TCP listener based on the provided configurations.
1 listener Listener|error? server1 = new (8080);
init (int localPort, *ListenerConfiguration config)
- localPort int
The port number of the remote service
- config *ListenerConfiguration
Configurations related to the
tcp: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
Binds a service to the tcp:Listener
.
1tcp:error? result = tcpListener.attach(helloService);
Parameters
- tcpService Service
Type descriptor of the service
detach
Stops consuming messages and detaches the service from the tcp:Listener
.
1tcp:error? result = tcpListener.detach(helloService);
Parameters
- tcpService Service
Type descriptor of the service