Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

message.clientId is null ??? #13

Open
MrGibbage opened this issue Jan 16, 2012 · 2 comments
Open

message.clientId is null ??? #13

MrGibbage opened this issue Jan 16, 2012 · 2 comments

Comments

@MrGibbage
Copy link

Using the example code, the message received (IMessage), which has a clientId parameter, is always null. Should this not be containing the client ID of the sender? Thus, it should never be null??

public class Listener : IMessageListener { //private BayeuxClient client; public void onMessage(IClientSessionChannel channel, IMessage message) { IDictionary ss = (IDictionary)message.DataAsDictionary; String foo = (String)ss["foo"]; String senderClientId = message.ClientId; // is always null if (senderClientId.Equals(Form1.clientId)) //should crash here { MessageBox.Show("I sent a message to myself"); } else { MessageBox.Show(ss["foo"].ToString()); } } }
@grEvenX
Copy link

grEvenX commented Jan 16, 2012

ClientID can be null, it depends on the situation.

See http://svn.cometd.com/trunk/bayeux/bayeux.html at the following sections: 3.1 and 4.1.2.
In order to understand why it's null in your case I would have to see more code.

@MrGibbage
Copy link
Author

It's basically the same code as yesterday.

https://gist.github.com/1620693

I only see one method for publishing, and neither one of them have anything to do with sending/not sending a clientId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants