Reading XML-Document from Networkstream

P

Peter

Hello,

I've to build an application that sends a request to a server and gets back
an answer, both as XML.

I create now a networkstream from a socket and the i can send my xml-request
by
MyXML.save (myNetworkstream), this seems to be without problems, on the
serverside, the request arrives.

But I have problems receiving the XML-Answer. The server will send his
answer maybe immediatly or after 1 or 5 min (the server makes an external
request via modem and will then send the answer he got from the remote outer
server).

When I try to receive the XML by myXML.read (myNetworkstream), the
application hangs until the answer comes.

Putting the send/receive in a backgroundworker would not be a good idea,
because the user then could send another request and I believe that 2 or more
backgroundworkers waiting at xml.read() wouldn't be good.

Another question is xml.save /read (networkstream) an "abstract" code that
will give the OS the handling of sending/receiving packets over the network?

Thanks for your suggestions!

Peter
 
D

Dale Atkin

Putting the send/receive in a backgroundworker would not be a good idea,
because the user then could send another request and I believe that 2 or
more
backgroundworkers waiting at xml.read() wouldn't be good.

Could you not set a flag when the request goes out, and comes back in so
that this wouldn't happen? (in other words, ignore, or raise an error when
the user tries to repeat the request).

Dale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top