Results 1 to 4 of 4
  1. #1

    SendMessageListener - SendMessage Android_StockListDemo

    Can anyone provide an example of how I would send a message back from the client, specifically in the Android_StockListDemo?

    Code:
               try {
                    lsClient.getLSClient().sendMessage("test");
    
    
                } catch(Exception e) {
                    Log.e(e.getMessage());
                }
    Gives me com.lightstreamer.ls_client.PushConnException: java.io.FileNotFoundException: http://192.168.1.148:8080/lightstrea...nd_message.txt

    I am pretty sure I need to configure MessageInfo and SendMessageListener but I am not sure how. Thanks.

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    The error you got is quite unexcpected.

    First of all, I assume that the getLSClient call returns a valid and connected LSClient instance (you can't send messages to the server if you don't have an open session).

    Can you please post your server log?

    It is not necessary to use a MessageInfo to send a message.
    You use such class if you need your messages to be handled in order by the server and/or if you want to know what's the outcome for the sent message. Otherwise you can use the basic sendMessage call that has only one String parameter (i.e.: string to be sent).

  3. #3
    I had to turn on the logging in my metadapter, the relevant bits:

    12-Nov-12 08:25:17,128|ERROR|LightstreamerLogger.pump.messag es|SERVER POOLED THREAD 4 |Error in message forwarding for XXXX_UNICAST: Wrong message received
    12-Nov-12 08:25:17,128|ERROR|LightstreamerLogger.connections |SERVER POOLED THREAD 4 |Failure in request processing: Error in message forwarding: com.lightstreamer.interfaces.metadata.Notification Exception: Wrong message received

  4. #4
    My problem was with the message format. I have formatted it correctly and sendMessage is now sending messages from the android client to the server and pushing them to the other clients. Thanks for your prompt response and suggestions.

 

 

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 02:05 AM.