Method: StartListening(intPortNumber)

Name: StartListening(ByVal intPortNumber As Integer)

Parameters: 1. IntPortNumber (Integer) - A valid system port number.

Returns: Boolean (True/False)

Description: Will attempt to begin listening for proxy messages from an UltraPort HL7 listener by binding to port number <IntPortNumber>. Returns True if successful and False if not. On failure check the LastError property for more information. If successful the PortNumber property is set to <IntPortNumber>.

 

Programming Notes: The most important thing to remember when calling this method is that on any computer at any given time only ONE application at a time can successfully bind to and listen on a particular port. The most common error developers make is in not understanding this concept. This means that if your proxy application is going to be running on the same computer as the UltraPort Listener and the UltraPort Listener is listening for HL7 messages on port 6001 then your proxy application MUST NOT try and use 6001. If you do then one of two things will happen. If your call to the StartListening(6001) method is successful, then that will mean that the UltraPort Listener will fail when it tries to start listening on port 6001 OR your call to StartListening(6001) will fail because the UltraPort Listener is ALREADY listening on that port for regular traffic.

 

Example Good UltraPort Listener Configuration

 

 

See Also: PortNumber, IsListening, LastError, ListenerStarted, StopListening