Results 1 to 10 of 12

Hybrid View

  1. #1
    Member
    Join Date
    Apr 2010
    Location
    DUiven
    Posts
    6

    Java to .NET port MessengerDemo

    Hi.,

    I ported the Java Messenger demo Data- and MetaDataAdapters to a .NET version. When I subscribe to the Adapters my buddylist is updated correctly on all subscribed sessions.
    However, when I try to send a new message to one of the subscribed buddies the lightstreamer server console gives me a very weird error.

    20.apr.10 12:12:48,986 < INFO> Sending message to session: S300999a1064e47b0T120
    6726 from 127.0.0.1:63303
    20.apr.10 12:12:48,987 <ERROR> Got exception for new message Messages[1] in session
    S300999a1064e47b0T1206726: Session error: Unsupported function

    Can you please provide me with some insights on how to resolve this error, or where to look for the solution.
    Because right now I really don’t know where to look anymore. I even tried to add the Console.WriteLine on every method
    In my MetaDataProvider, but after the web client calls engineref.sendMessage() the MetaDataAdapter .NET method “NotifyUserMessage()” never gets called.

    Thanks in advance

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    The "Unsupported function" message is the default no-op behavior for NotifyUserMessage that is defined in the MetadataProviderAdapter class.
    This class is supplied in LS library as a possible base class for a custom Metadata Adapter.
    The sample LiteralBasedProvider also inherits from this class.

    Is it possible that your Metadata Adapter class does not override NotifyUserMessage properly?
    You can ensure that by removing any dependance from MetadataProviderAdapter.

  3. #3
    Member
    Join Date
    Apr 2010
    Location
    DUiven
    Posts
    6
    Hi,

    well i indead use the LiteralBasedProvider as my class inheritance. following is my ported from java implementation of the NotifyUserMessage method:

    public override void NotifyUserMessage(String user, String session, String message)
    {
    Console.WriteLine("NotifyUserMessage");
    try
    {
    if (message == null)
    {
    //logger.warn("Null message received");
    throw new NotificationException("Null message received");
    }

    //Split the string on the | character
    //The message must be of the form "SDNINBOXNOTIFICATIONSERVER|fromId|toId|messag e"
    Char[] SplitChar = "|".ToCharArray();
    String[] pieces = message.Split(SplitChar);

    Console.WriteLine("New incoming data: " + "User: " + user + " session: " + session + " message: " + message);

    SetupConnectionPipe();
    HandleNewIncomingInboxData(pieces, message, user);
    }
    catch (Exception Error)
    {
    Console.WriteLine("what fsdfsdfs: " + Error);
    }
    }

    But Console.WriteLine doesn't get called, hence nothing is called in this method. The only thing i see is dat the Constructor of my class wich inherits LiteralBasedProvider and also the overrided Init method gets called on execution. When i press the button with executes the sendMessage() method the console provided me with the Session error, error.

    Grtz,

    Micha

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    I can't replicate the issue.
    I wonder whether your use of String instead of string in the method declaration may have any platform-dependent issue.
    I still suggest you trying to remove the inheritance from MetadataProviderAdapter (hence, from LiteralBasedProvider),
    so that any overriding issue is transferred at compilation level.

  5. #5
    Member
    Join Date
    Apr 2010
    Location
    DUiven
    Posts
    6
    Hi,

    i tried both of the methods. Replaced String with string in the method declaration but no success. I removed the inheritance from the LiteralBasedProvider but i got the same message on the lightstreamer server console. So it looks like he doesn't understand that he needs to call my MetaDataAdapter. Can it be an issue that i use a standalone server launcher, same as in the PortfolioDemo? The weird thing is, that on startup of both the consoles the constructor and the overrided Init method of the MetaDataAdapter i wrote gets called.


    Should i post more code?

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    The standalone Remote Server launcher, as provided in our examples, directly creates an instance of the Metadata Adapter,
    so, if you properly extended it to use your class, it should not cause problems.

    However, if there is a configuration issue, a different Metadata Adapter may be attached by the Server.
    As a first step, please show us the Server log, after performing the following settings:
    - set the com.lightstreamer.adapters.remote category to DEBUG level;
    - ensure that the LightstreamerLogger.init category is at INFO level.

 

 

Similar Threads

  1. Specify Port on URL
    By leonardo.magalhaes in forum Client SDKs
    Replies: 1
    Last Post: February 27th, 2012, 11:00 AM
  2. Replies: 4
    Last Post: January 11th, 2011, 10:21 AM
  3. How to port from LS server to a webserver
    By UweF in forum Client SDKs
    Replies: 1
    Last Post: December 2nd, 2010, 09:25 PM
  4. Setting domain, host and port on IE 6 & IE 7
    By Otake in forum Client SDKs
    Replies: 2
    Last Post: November 26th, 2009, 06:58 PM
  5. Replies: 1
    Last Post: May 21st, 2009, 09:41 AM

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 07:58 AM.