|
OK. You should have posted this in one location only. Please don't crosspost as it's rude.
|
|
|
|
|
We are creating a chat client application where we need to push messages to mobile clients.
No we have WCF service and client is requesting service every 3 minutes.
Is there a way we can use WCF to push data to clients over HTTP?
|
|
|
|
|
You need to probably take a look at Duplex Services - see this blog[^]. Apart from this you can read more about these type of services on msdn.
|
|
|
|
|
nitin_ion wrote: Is there a way we can use WCF to push data to clients over HTTP?
There is no way to push over HTTP full stop, never mind with WCF. HTTP is based on a request/response model so you can only send data in response to a request made by the client.
|
|
|
|
|
That's not entirely correct. It is possible to establish a polling duplex HTTP connection. You can find details here[^] on HTTP push.
|
|
|
|
|
Most of those are essentially faking a push. Re-using a connection would count but I didn't think the browser/service client would accept a second response within the same connection if it hadn't requested it.
|
|
|
|
|
And this is why I was careful to say a Duplex connection - so that the client knows that the response will be left open.
|
|
|
|
|
Push is evil, don't use it.
Always use polling.
|
|
|
|
|
Yep.
And like extra worse for a chat mobile application.
|
|
|
|
|
For a web service, yes. There are other scenarios where that's definitely not the case though (when the speed of update to clients is critical and the number of clients relatively low).
|
|
|
|
|
BobJanova wrote: There are other scenarios ...
Never for a "chat" service. That means humans. And with a low number even less point.
|
|
|
|
|
I'm writing a C# program that reads RSS feeds and displays them on a windows form... The program first worked fine, no problem, but suddenly it began to crash once I had navigated in the web browser control in the C# program. I got into some sort of knowing what causes the problem... When provide the web browser using WebBrowser.DocumentText = sting with large amount of data it does crash... so does anybody have a solution for that??
sb.Append("");
sb.Append(row.title);
sb.Append("
");
sb.Append(ASCIIEncoding.ASCII.GetString((byte[])row.desc));
desc_self_nav = false;
webBrsrRSSDesc.DocumentText = sb.ToString()
|
|
|
|
|
Is it the webbrowser that crashes, or the stringbuilder? Can you paste the text of the exception that it throws?
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: Is it the webbrowser that crashes, or the stringbuilder?
That's what the OP wants to know.
Eddy Vluggen wrote: Can you paste the text of the exception that it throws?
Obviously, if there was an exception, it would not be called a crash.
|
|
|
|
|
Shameel wrote: That's what the OP wants to know
Not so hard to find out, is it? Just put the contents of the StringBuilder in a (temp) string, and assign it to the browser on the second line.
Shameel wrote:
Obviously, if there was an exception, it would not be called a crash.
Thanks for the useful hint
Bastard Programmer from Hell
|
|
|
|
|
Shameel wrote: Obviously, if there was an exception, it would not be called a crash.
Not true. If he hasn't handled the exception it would still crash, but there would still be an exception.
|
|
|
|
|
Pete O'Hanlon wrote: but there would still be an exception.
Correct, but in case of a crash, the OP would not be able to post the exception here, and that is what I was pointing out to.
|
|
|
|
|
I'm pretty sure that an unhandled exception would be written to the event log if it crashed an application. It's been so long since I've written an application where I didn't have a top level exception handler, but I'm fairly certain this is the case.
|
|
|
|
|
Non curo; if he's working with computers, then he should be able to tell a bit more than "it crashed". Your basic helpdesk-employee will tell you that there are different kind of crashes - should I simply assume that it generated a BSOD?
Most people here are referring to "exceptions" when they're talking about code and "crash".
Bastard Programmer from Hell
|
|
|
|
|
Ash Zidan wrote: but suddenly it began to crash once
And that means what exactly?
What exactly is the evidence that you see?
|
|
|
|
|
Try storing the content of the StringBuilder to a temporary html file and use WebBrowser.Navigate method to load the file. This will help you in isolating the real culprit - the StringBuilder or the WebBrowser.
|
|
|
|
|
PropertyDescriptor.GetValue(object component);
what is this component. I do not get. Can someone please get an example.
Also why PropertyInfo.GetValue(object, objects[]) needs to have parameters. Why we cannot have values through reflection directly. Can someone give me example of propertydescriptor.GetValue(object component), how to use it. I do not find much on msdn.
|
|
|
|
|
kashme wrote: what is this component
It's an abstract description of a property[^].
kashme wrote: Can someone please get an example
At the bottom of that page are the usual examples.
Used it for example, when implementing a GetProperties [^] method. A neat way to provide properties that a PropertyEditor can understand while passing an array wrapped in a ICustomTypeDescriptor[^].
Bastard Programmer from Hell
|
|
|
|
|
Hello,
I am writing unit test to a method named methodName for example. The tested class extends another base class.
The tested method uses a method that is implemented in the base class, But i want to use Mock in order to Mock this method.
How can i do it?
|
|
|
|
|
Something like this;
class MyBaseClass
{
public virtual string methodName()
{
return "This is base calling";
}
}
class MyTestedClass: MyBaseClass
{
public override string methodName()
{
return "This is the testing value calling";
}
}
class MyTestedClassMock: MyBaseClass
{
public override string methodName()
{
return "Whaahaha, I'm not the real one, just a mock-stand in.";
}
}
MyBaseClass someObject = new MyTestedClassMock();
MessageBox.Show(someObject.methodName());
Bastard Programmer from Hell
|
|
|
|