Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement a Comet server in C#

I would like to know whether there is a way to write a comet server in C#. i have a C# code that generates data periodically, and I want to push these data to a java app. So would like to convert my C# code to a comet server. Also would like to know whether there is any comet server implemented that lets us connect the C# application and java application to it, so that the C# application can pass information to the java app, through the comet server. data push frequency would be high, but the size of an individual message is very small: a string value.

like image 736
sura Avatar asked Nov 14 '09 02:11

sura


2 Answers

Let's get this straight.

I'm assuming this is a followup to this question: communication between Java and C#

This is app to app communication on the same machine with only strings as the payload, right?

Why COMET? Why not just send null terminated strings directly via a socket connection? Implementing a Comet server is far from trivial, and is only used in situations where more direct communication is disallowed (i.e. server to browser push). Comet for app to app communication on the same machine would be very complex for a solution that is easily solved with sockets.

like image 109
spender Avatar answered Sep 27 '22 18:09

spender


It can definitely be done, but writing a comet server in c# is a fairly complex task. We've built one (WebSync), and it took quite some effort. If you're just doing a research project, you can use the OnDemand version, which is hosted, and has 10 free users. Right now, the Server version isn't free, but is pretty cheap...

For what it's worth, if you do decide to roll your own, you're going to be looking at the IHttpAsyncHandler, and you'll need to do some thread management to deal with the default threadpool limits in IIS.

like image 31
jvenema Avatar answered Sep 27 '22 17:09

jvenema