While using Socket, I am able to read the data as
while (socket.bytesAvailable)
{
textArea.text += socket.readUTFBytes(socket.bytesAvailable);
}
How can I read the data while using an XMLSocket? Is it enough to use xmlSocket.toString() ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, with XMLSocket receiving data is event driven, you create a socket, set up event handlers:
you will receive data in dataHandler:
Now you can process XML using whatever means you want. Sending is easier, but still you have to take into account that you are not connectd immediately after calling connect, you have to wait until connectHandler gets called before sending data: