Results 1 to 4 of 4
  1. #1

    Waiting for connection port 7001 and 7002

    Hi there,

    Im deploying my Lightstreamer Server using ARI. Im doing exactly as the demo ARI guide.

    When i start the Lightstreamer, the console says that its "Waiting for connection port 7001 and 7002". While its waiting, my lighstreamer not listen on 8080. Only when some TCP/IP socket connections connected on port 7001 and 7002, the lightstreamer gets started on port 8080.

    Is it mandatory to wait for connections to get the Lightstreamer starts ?

    By the way, i'm using php (the php code in this forum) to push data. If theres no any web clients connect using Javascript API, my Lighstreamer gets error and self terminate the 7001 and 7002 connection with the php code Is it a problem ?

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    You can have the Server start before the connnection to the Remote counterpart has taken place by configuring a "robust" Proxy Adapter (see the example in DOCS-SDKs\sdk_adapter_remoting_infrastructure\conf\sock ets(robust) ).
    In this case, the startup behavior is governed by the "missing_connection_timeout_millis" parameter supplied to the Proxy Adapter.

    I confirm that the presence of some connected client is needed in order for the Remote Data Adapter to to anything useful;
    but in the meantime the Server has no reason for closing the connections. Until the first client subscribes to anything, your PHP code should be waiting on fscanf.
    Please specify the error message issued.

  3. #3
    Quote Originally Posted by DarioCrivelli View Post
    You can have the Server start before the connnection to the Remote counterpart has taken place by configuring a "robust" Proxy Adapter (see the example in DOCS-SDKs\sdk_adapter_remoting_infrastructure\conf\sock ets(robust) ).
    In this case, the startup behavior is governed by the "missing_connection_timeout_millis" parameter supplied to the Proxy Adapter.

    I confirm that the presence of some connected client is needed in order for the Remote Data Adapter to to anything useful;
    but in the meantime the Server has no reason for closing the connections. Until the first client subscribes to anything, your PHP code should be waiting on fscanf.
    Please specify the error message issued.
    Okay, thanks for reply. By the way, i would like to ask one more questions.
    The Adapter config in HelloWorld Example consists of Meta Adapter and Data Adapter. I see we can config port in Data Adapter, but theres no any configs in the Meta Adapter tag. As i read, the Meta Adapter will manage authentication. So what can we config in the Meta Adapter tag below ?

    Code:
    <metadata_provider>
     <adapter_class>com.lightstreamer.adapters.metadata.LiteralBasedProvider</adapter_class>
    </metadata_provider>

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    In the proposed example the Metadata Adapter functionalities are delegated to the "LiteralBasedProvider" (please refer to this GitHub project for source code). That is a ready-made Metadata Adapter, based on Java, which is provided as part of the Lightstreamer SDK as sample for inspiration and/or extension.

    If you want to implement your specific Metadata Adapter functionalities, and specifically the management of authentication, then you must specify a new port to listen for the Metadata Adapter.

    Code:
    <!-- Mandatory. The Metadata Adapter is the Java Proxy Adapter. -->
        <metadata_provider>
    
            <!-- Mandatory. The NetworkedMetadataProvider communicates with its
                 remote counterpart through standard TCP sockets. It listens on
                 a specific port and waits for its counterpart to connect. -->
            <adapter_class>com.lightstreamer.adapters.remote.metadata.NetworkedMetadataProvider</adapter_class>
    
            <!-- Optional. If "Y", ensures that all Table (i.e. Subscription)
                 notifications (that is, all the invocations to the Notify New Tables
                 and Notify Tables Close methods) pertaining to the same session will
                 be sequential, with no overlapping; if "N", then concurrent
                 invocations will be possible.
                 Note that the final invocation to Notify Session Close is always
                 guaranteed to occur after all the above notifications have terminated.
                 
                 If not defined, the default value is "Y" (i.e. do sequentialize). -->
            <!--
            <sequentialize_table_notifications>N</sequentialize_table_notifications>
            -->
    
            <!-- Mandatory, specific for NetworkedMetadataProvider.
                 The request/reply port to listen on. -->
            <param name="request_reply_port">7700</param>
    
            <!-- Optional, specific for NetworkedMetadataProvider.
                 The local network interface to bind to.
                 If not specified, it will bind to any available interface. -->
            <!--
            <param name="interface">192.168.1.1</param>
            -->
    
            <!-- Optional.
                 Name of the Proxy Metadata Adapter, to better identify its threads when
                 assessing problems. If not specified, it will be assigned a progressive number. -->
            <!--
            <param name="name">MyFeedMetadata</param>
            -->
    
            <!-- Optional, specific for NetworkedMetadataProvider and its subclasses.
                 If true, the Proxy Adapter will wait for the completion of the
                 initialization of the remote counterpart before beginning to
                 forward requests; any exception occurred during initialization
                 will be received.
                 It can be set to false only in order to enforce compatibility
                 with remote servers compliant with ARI version older than 1.5,
                 which don't support remote initialization requests;
                 on the other hand, a setting to false would not be supported by
                 remote servers compliant with ARI version 1.5 or newer.
                 Default: true. -->
            <param name="init_remote">false</param>
    
            <!-- Optional, specific for NetworkedMetadataProvider, ignored if
                 "init_remote" is false.
                 Determines the initialization parameters to be sent to the remote
                 counterpart.
                 The supplied value is meant as a prefix, such that all parameters
                 supplied to this Proxy Adapter and whose names start with this
                 prefix will be sent (an empty value is also supported, to match
                 all parameters).
                 Moreover, the following parameters, with obvious meaning, will
                 also be sent:
                 - adapters_conf.id
                 Default: if not defined, no initialization parameters will be
                 sent at all. -->
            <!--
            <param name="remote_params_prefix">remote_</param>
            -->
            <!--
            <param name="remote_xxxx">my value for the remote counterpart</param>
            -->
    
            <!-- Optional.
                 Timeout for sent requests. A negative value stands for an unlimited timeout.
                 Timed out requests are considered as failed and later answers are ignored.
                 Default: 10000 ms (10 seconds). -->
            <!--
            <param name="timeout">10000</param>
            -->
    
            <!-- Optional.
                 If set to false, suppresses clearing of the cached profile data
                 for a user when no sessions for the user are active. This is only for
                 troubleshooting purpose, as profile data are always refreshed upon
                 notifyUser requests.
                 Default: true. -->
            <!--
            <param name="clear_on_session_close">true</param>
            -->
    
            <!-- Optional.
                 Sets the minimum time (in milliseconds) cached profile data are kept;
                 these cached data are needed in order to manage request processing before a session
                 is fully started. Ignored if clear_on_session_close is false.
                 Default: 10000 ms (10 seconds). -->
            <!--
            <param name="user_data_timeout">1000</param>
            -->
    
        </metadata_provider>
    And on this new port you have to connect with a new program or a new part of the one already in use, that responds to all requests from the Lightstreamer server. For a complete description of the protocol to manage refer here.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 10:12 AM.