Closed mirkarpude closed 8 years ago
Hi,
This is handled with Event Handlers. You should use the public event EventHandler<MessageEventArgs> Message
event. E.g. if _xmppClient
is your XmppClient
instance then _xmppClient.Message += yourMessageHandler
will do the trick. Depending on your application this should be inside a shorts of loop from the receiving side.
Dear pgstath If u have time please give me small small from begin for receiving msg in chat application
Dear sir I tried, now receiving msg. but an error is there 1) Exception Message "A blocking operation was interrupted by a call to WSACancelBlockingCall"
2) Exception Message "A blocking operation was interrupted by a call to WSACancelBlockingCall" in streamParser.cs
3) + Caught: "Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall." (System.IO.IOException) Exception Message = "Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall.", Exception Type = "System.IO.IOException", Exception WinRT Data = "" in XmppCore.cs > ReadXMLStream.. DispatchEvents
What is the environment that your application is targeting? Also if you could attach a sample of source code this could be helpful.
Dear pgstath. Actually I was tested your code. Its good
I want to buil android xmpp jabber app to receive notifications from any windows and web software. Now its working fine in windows. Pls guide me to use your code in xamarin android and ios
Good to learn this! I will share a post about using Sharp.Xmpp in Android. Sharp.Xmpp is extensively tested in Android, but not in iOS. Nothing particular is needed, just add the code in your Xamarin application. I wll let you know when some update is ready
Dear pgstath,
I have a problem when implementing the code for receiving messages in my Xamarin Android project. In a console application it works fine, but in my android application, it will not reach my eventhandler. I have set up the eventhandler before I connect.
I am seeing a similar issue but with .NET framework on Windows. I have created an XmppClient and am listening for messages by subscribing to Message event. At the other end, I have Pidgin send a message. The event handler is not invoked. If I send a message to Pidgin first, then send a message from Pidgin, the event handler is invoked. Any thoughts on why I need to send a message to start receiving messages?
Update: The messages were probably not being delivered because I had another instance of Pidgin logged in with the same user as XmppClient. Tried again after quitting that instance of Pidgin and receiving message works.
as I m new please show me how to receive a message using sharp.xmpp.client. from recipient
In documentation there is coding example for send not for receiving please guide me