SO Members,
Let me breakthrough the steps:- 1 ) I have created the TCP Listener in the separate Class that is started. This class will look for possible clients to connect to it.
2 ) I have created a TCP client in another Class that will POST the data in the TCP LISTENER stream. i.e., Will create a webrequest to the TCP listener HTTP URL and start posting the data in the stream i.e., using (var stream = HTTPWebrequest.GetRequestStream()) and starts writing using stream variable.
- Then, I have created a another TCP client that connects to the TCP lister in the get mode using webrequest , and webresponse in the 'GET' mode. This stream will fetch the stream by StreamReader reader = new StreamReader(HTTPWEBRESPONSE.GetResponseStream())
But, The Client that POST the data does not start before client that GET the data . so after step 3 , StreamReader reader = new StreamReader(HTTPWEBRESPONSE.GetResponseStream()) reader.endofStream times out (while debugging and quits without exception and jumps off from that series of code forever) because the data is not yet available in the stream.
Is there a solution to accomplish this approach. Is there any other way to achieve this approach for tcplistener process1 , HTTPWEBREQUEST process2 , HTTPWEBRESPONSE process3 .
Thanks in Advance !!