Multiple connection from 1 client to 1 server

125 views
Skip to first unread message

David P.

unread,
Apr 5, 2016, 12:02:13 PM4/5/16
to cometd-users
First I need to say that I do not have access to the CometD Server, and it's not possible (at this time) to modify current server implementation, which is part of Genesys Cloud offer (see http://www.genesys.com/solutions/cloud/offers).
At this moment, the server expose several topic to subscribe on, but they are specific for 1 user, identified by its authentication when connecting to CometD.

I'm trying to get notifications for multiple users while using a .Net application (using CometD.Net from https://github.com/nthachus/CometD.NET and also using a fast-and-dirty rewrite of actual CometD 3.x Java version).

Sometime, it works for 1 or 2 users listeners, sometime for only 1 and sometime for none... and I need to be able to get notification for hundreds of users!

When trying to manage cookies (JSESSIONID and BAYEUX_BROWSER) for keeping only the last up-to-date one for all request, it works... at least more often than with the original code.
After re-reading the CometD Reference Book, it looks that the "Chapter 8. Java Libraries" exposes in section "4.8 Multiple Sessions" a limitation that the CometD Server should not care about multiple clients and only reply to 1 long-pooling request.

My question is made of 2 parts:
  • is it possible to by-pass this limitation without having the possibility to manage it on the server-side?
  • is there any other "stable" CometD library for using with C# (.Net) (already give a try to https://github.com/couchand/CometD.NET without success: can not connect to CometD server)?
Maybe a third question (for fun...): is there anybody using Genesys CometD Server and .Net in the world?

Thanks,
David.

Simone Bordet

unread,
Apr 5, 2016, 1:32:11 PM4/5/16
to cometd-users
Hi,

On Tue, Apr 5, 2016 at 5:55 PM, David P. <david....@gmail.com> wrote:
> First I need to say that I do not have access to the CometD Server, and it's
> not possible (at this time) to modify current server implementation, which
> is part of Genesys Cloud offer (see
> http://www.genesys.com/solutions/cloud/offers).
> At this moment, the server expose several topic to subscribe on, but they
> are specific for 1 user, identified by its authentication when connecting to
> CometD.
>
> I'm trying to get notifications for multiple users while using a .Net
> application (using CometD.Net from https://github.com/nthachus/CometD.NET
> and also using a fast-and-dirty rewrite of actual CometD 3.x Java version).
>
> Sometime, it works for 1 or 2 users listeners, sometime for only 1 and
> sometime for none... and I need to be able to get notification for hundreds
> of users!
>
> When trying to manage cookies (JSESSIONID and BAYEUX_BROWSER) for keeping
> only the last up-to-date one for all request, it works... at least more
> often than with the original code.
> After re-reading the CometD Reference Book, it looks that the "Chapter 8.
> Java Libraries" exposes in section "4.8 Multiple Sessions" a limitation that
> the CometD Server should not care about multiple clients and only reply to 1
> long-pooling request.

I'm not sure where you get the section numbers, but the reference book
section you mention is here:
https://docs.cometd.org/current/reference/#_java_server_multiple_sessions

> My question is made of 2 parts:
>
> is it possible to by-pass this limitation without having the possibility to
> manage it on the server-side?

If you are using a non-browser client (I understand it's a C# client),
there is no limitation.

> is there any other "stable" CometD library for using with C# (.Net) (already
> give a try to https://github.com/couchand/CometD.NET without success: can
> not connect to CometD server)?

The last one that I know was working was https://github.com/Oyatel/CometD.NET.
I see that couchand's is a fork of Oyatel's, while nthachus's looks
like a transpilation.

Unfortunately there is no "official" CometD.NET client maintained by
the CometD Project (too little request for too much effort).

I have not tried, but there are a number of solutions to call Java
code from C#, ranging from IKVM
(http://www.ikvm.net/devguide/net2java.html) to jni4net
(https://github.com/jni4net/jni4net/wiki/Calling-Java-in-C%23).

Another similar solution would be to call the JavaScript library from C#.

Any solution you find, I am interested in knowing the details.

Thanks !

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.

David P.

unread,
Apr 8, 2016, 3:47:03 AM4/8/16
to cometd-users, sbo...@webtide.com
Hello,

I was busy the days after I posted, but I appreciate your quick response, thanks,
I mentionned section numbers from this reference website, but I used wrong reference ids (how I did this...).
 

> My question is made of 2 parts:
>
> is it possible to by-pass this limitation without having the possibility to
> manage it on the server-side?

If you are using a non-browser client (I understand it's a C# client),

Yes, the idea is to use a .Net client into a Windows Service (or maybe ASP.Net application) to listen CometD server.
 
there is no limitation.

OK, so it looks that I may have a bug/issue with the library we used
 

> is there any other "stable" CometD library for using with C# (.Net) (already
> give a try to https://github.com/couchand/CometD.NET without success: can
> not connect to CometD server)?

The last one that I know was working was https://github.com/Oyatel/CometD.NET.

I was unable to even being connected to the CometD Server with this version.
 
I see that couchand's is a fork of Oyatel's, while nthachus's looks
like a transpilation.

I had the same feeling, and I admit that for my "fast-and-drity" rewrite I was inspired by this both sources
and began with a transpilation followed by a fork/rewrite of major method in order to be more .Net's spirit friendly.
 

Unfortunately there is no "official" CometD.NET client maintained by
the CometD Project (too little request for too much effort).

It's too bad, but it's understable, in the .Net world (which I use more) there is now other solutions 
like SignalR which is more supported by MS/.Net .
 

I have not tried, but there are a number of solutions to call Java
code from C#, ranging from IKVM
(http://www.ikvm.net/devguide/net2java.html) to jni4net
(https://github.com/jni4net/jni4net/wiki/Calling-Java-in-C%23).

Another similar solution would be to call the JavaScript library from C#.

We already think about this solution, but that will be after trying any other "elegant" solutions.
But I read that even if can call JS from C#, we do not have all objects (like for example XmlHttpRequest object),
so we won't be able to connect without some tricks or hacks.
 

Any solution you find, I am interested in knowing the details.

I will try to keep this thread up-to-date if I find any working solution (I hope).
 

Thanks !

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Thanks,
David 
Reply all
Reply to author
Forward
0 new messages