The steps I need to do is

   1. Connect to the server which sends a "greeting xml"
   2. Send a login command (xml) and receive a xml response which I check 
   and if it is valid go to 3
   3. Send another command (xml) and receive a xml response which I check 
   and if it is valid call a callback function with a result
   
In your code how would you get the response and check it after your 
.write() call?

On Friday, October 4, 2013 10:07:18 AM UTC+2, greelgorke wrote:
>
> receive a message and send a new one in the receive-handler
>
> stream.on('readable', function() {
>       var data = stream.read()
>       if (data.length === 4) return;
>       var response = parser.toJson(data, { object: true })
>         *stream.write(JSSON.stringify(newMessage))*
>       console.log(response)
> })
>
>
>
> Am Donnerstag, 3. Oktober 2013 22:58:01 UTC+2 schrieb Martin Lundberg:
>>
>> Hi,
>>
>> On Wednesday, September 11, 2013 10:27:22 AM UTC+2, greelgorke wrote:
>>>
>>> if the one-connection-per-request doesn't fit your requirements and you 
>>> want to use a single connection for multiple requests, than you have to 
>>> send a request after you got a response and then wait for the next response.
>>>
>>
>> This is what I want, I want to send multiple request/response (send a 
>> request and get the response) on one and the same connection. However it's 
>> this I'm not sure how to do. Anyone know of any example code which does 
>> this or can someone show me an example here?
>>
>> Best wishes,
>>
>> -- Martin
>>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to