locked
Suggestions over chat application? RRS feed

  • Question

  • User-140528697 posted

    Hi Friends,

    Im developing a custom chat application where in i want to find out whether the other person who as typed in a message is sent some message without the information being stored in the database .Tht will be like

    1. The user types in some message and clicks on Send

    2.The message will not be stored in any database or some XML file i want to retrive it once the user clicks on it..!!? Can we use a delegate  im a little confused with the concept of delegates .Any suggestion would be appreciated.

    Thank you,

    Regards

    Francis P. 

     

    Saturday, March 15, 2008 1:25 AM

Answers

  • User-1136466523 posted

    Hi,

    I think what you are talking about is the asynchronous delegates in WCF service.


    "The .NET Framework allows you to call any method asynchronously. To do this you define a delegate with the same signature as the method you want to call; the common language runtime automatically defines BeginInvoke and EndInvoke methods for this delegate, with the appropriate signatures.

    The BeginInvoke method initiates the asynchronous call. It has the same parameters as the method you want to execute asynchronously, plus two additional optional parameters. The first parameter is an AsyncCallback delegate that references a method to be called when the asynchronous call completes. The second parameter is a user-defined object that passes information into the callback method. BeginInvoke returns immediately and does not wait for the asynchronous call to complete. BeginInvoke returns an IAsyncResult, which can be used to monitor the progress of the asynchronous call.

    The EndInvoke method retrieves the results of the asynchronous call. It can be called any time after BeginInvoke; if the asynchronous call has not completed, EndInvoke blocks the calling thread until it completes. "

    Here’s a sample on WCF chat application. Please see:
    http://www.codeproject.com/KB/WCF/WCFWPFChat.aspx

    You may go to MSDN WCF service forum so that you can get further help.

    Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 16, 2008 9:52 PM

All replies

  • User-1136466523 posted

    Hi,

    I think what you are talking about is the asynchronous delegates in WCF service.


    "The .NET Framework allows you to call any method asynchronously. To do this you define a delegate with the same signature as the method you want to call; the common language runtime automatically defines BeginInvoke and EndInvoke methods for this delegate, with the appropriate signatures.

    The BeginInvoke method initiates the asynchronous call. It has the same parameters as the method you want to execute asynchronously, plus two additional optional parameters. The first parameter is an AsyncCallback delegate that references a method to be called when the asynchronous call completes. The second parameter is a user-defined object that passes information into the callback method. BeginInvoke returns immediately and does not wait for the asynchronous call to complete. BeginInvoke returns an IAsyncResult, which can be used to monitor the progress of the asynchronous call.

    The EndInvoke method retrieves the results of the asynchronous call. It can be called any time after BeginInvoke; if the asynchronous call has not completed, EndInvoke blocks the calling thread until it completes. "

    Here’s a sample on WCF chat application. Please see:
    http://www.codeproject.com/KB/WCF/WCFWPFChat.aspx

    You may go to MSDN WCF service forum so that you can get further help.

    Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 16, 2008 9:52 PM
  • User-140528697 posted

     Hi Nia,

    Thank you for the reply. Really appreciate that .I have another question to you .

    I have a web site which has a page in it called Common.aspx which would have a textbox control.

    Assume 10 users access the page so they have 10 instances of the page Common.aspx

    Now, There s another Page say Admin.aspx which as a button in it and on click of that button i want to update all the 10 instances of the page Common.aspx textbox control to some value at the same time.Any idea as to how can i do that..!?? 

    Regards,

    Francis P. 

    Monday, March 17, 2008 3:40 AM
  • User-60428002 posted

    You can't achieve that. THe controls on each page class are private, and there instance are in different app domain... Besides, http is no status, imagine, when you click the button, would those textboxes' values be reload? what kind of mechenism to support that? You should read more on C# coding.

    Monday, March 17, 2008 10:04 PM