English 中文(简体)
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.

问题回答

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.

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.

You may need some sample source code for your implementation? PokeIn reverse ajax library was an open source project and the source codes for earlier versions still downloadable at codeplex site.

Obviously, the latest version of PokeIn library is one of the most great libraries for .Net framework and you may use their free community edition.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签