1

I'm trying to learn XMPP chat using c# asp.net

I was sucessfully able to connect to facebook chat and send messasge.

Now I want to know to do I receive the message which other person has send me as reply.

Do we need to add listeners to TCP socket which we have used for sending message.

I don't want to use any XMPP library.

Please let me know, if there is any tutorial or good explanation about how messsages can be received?

My code to send message:

 xml = "<message type='chat' from='-1034430826@chat.facebook.com' to='-100000960474935@chat.facebook.com' xml:lang='en' ><body>hi This offline message1</body></message>";
        message = Encoding.UTF8.GetBytes(xml);
        sslstream.Write(message);
        sslstream.Flush();   //sending the response to the server with my parameters
        myResponseAsSB.Clear();
lukiffer
  • 11,025
  • 8
  • 46
  • 70
kevin zen
  • 79
  • 1
  • 6
  • 1
    I'm afraid I'm going to skip answering this one - you really should use an XMPP library, or give a valid reason (of which I can't think of many) for not using one. If you want to start from scratch, see the tutorials and specifications linked from this question: http://stackoverflow.com/q/3092534/15996 – MattJ May 03 '12 at 00:08
  • 1
    This is more about socket level programming than XMPP. Your question is not specific to XMPP but how to send and receive messages at the socket level. I agree with @MattJ, if you are trying to learn XMPP, then use an existing XMPP library. You will have to learn some basic network programming before you worry about the application protocol, based on your question. – Robin May 03 '12 at 13:35
  • yes, I agree with robin, its more on socket programming[which I have encountered while dealing with XMPP], so can you please tell me , how can I receive data over TCP socket, can we implement socket listener for it?, can listeners work over HTTP, please let me know if there is good tutorial or reference of sending and receiving data over TCP using asp.net – kevin zen May 04 '12 at 14:04

0 Answers0