Returning a FileStream over a remoting connection
Here's the scenario:
I have many PC's on my network, and I need to programmatically pull files off of each one. I have a windows service that is hosting a remoting object (using TCP Channels).
From my main PC I am able to successfully get files if I return them from the remoting object as a byte array. However, when I return a FileStream I get a connection error. Here is a snippet:
FileStream tmps = remoteObject.getFileStream(@"C:\test.txt"); MessageBox.Show(tmps.Length.ToString()); < this is the line that fails with the error: "System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it." Now the odd part is, if I run that same remote object in a windows service on my local machine it works fine. Am I missing something here? If this was your scenario, could you think of a better way of doing it? My issue is these files are quite large (150-2000 MB). Returning them as a byte array from the remote object is causing a lot of memory issues. If I could return a filestream then I can process the file in chunks so the entire file is never in memory.

