The connection could not be made because the target machine actively refused it.

Hi. I've developed an application for transfering files between a client a server. There is a remotable object in server hosted in IIS which has a method named "UploadFile". Client portion is a Windows Application project which gets a reference to the remotable object and calls "UploadFile" to send a file to the server.

File is sent by being broken into many chunks sent sequentialy. I've a class named "FileData" which encapuslates a Stream object. So, to send a file to the server, I instantiate the Stream object using the path provided and use the FileData object to the server.

I receive the following error during the transfer:

No connection could be made because the target machin actively refused it.

I added some code to find the reason this is happenning. I noticed that it happens when the Server tries to read FileData.Stream.Length to find out the length of file that is being transfered. In other words, I think the server is trying to read this data from client but client does not allow it to do so. I disabled any Firewall or Anti-virus applications running my server but still have the same problem.

Please note that I don't have this problem when Server and Client are on my local computer. But when I uploaded Server to a computer on the Internet, I receive this error.

Does any body know how to solve this problem



Answer this question

The connection could not be made because the target machine actively refused it.

  • supersonic_oasis

    Has anyone replied why running remote server and remote client on different machines cause connection refused message

    regards

    Puangpetch


  • tweston

    Romance82m, is FileData a MarshalByRefObject Can you post the source for FileData and the object containing UploadFile()

    Cheers,

    JJustice [MSFT]


  • The connection could not be made because the target machine actively refused it.