views:

842

answers:

3

I'm using .NET remoting to communicate between a web site and a Windows service. They both live on different machines. I have a statically defined port number for use by all requests and responses.

I also use this mechanism to transfer files from the web site to the Windows service box. I'm passing a Stream object in the object that is being remoted to the Windows service box. The web box is opening another, seemingly random, port to facilitate this request that includes the file Stream.

Is there a way to specify which port this file Stream should use? Anyone know why it doesn't want to use the port I have defined and that all my other requests/responses use with no problem?

I'm using .NET Framework v2.

+1  A: 

Here is someone who has implemented file transfer with .NET remoting:

http://www.codeproject.com/KB/dotnet/Net%5FRemoting%5FEvents.aspx

Source code is available from a link on the page.

However, I agree with the comment from John Saunders that you should move to WCF.

Shiraz Bhaiji
Thank you... :-)
John Saunders
A: 

Check this out: http://www.genuinechannels.com/Content.aspx?id=23

Very nice solution to transfer / send files using .NET Remoting.

Jarek
+1  A: 

Just read your stream into a byte[] then pass that. Exactly what I did when came across this situation.

Nick Whaley