HttpChannel or TcpChannel?

Hi,

I've been developing an application to transfer files between a client and a server. There is a remotable objected hosted in IIS on the server. The client portion uses a desktop application to transfer fiels between client and a server.

To pass through firewalls, I decided to use HttpChannel but I found the following in MSDN:

A HttpChannel opens only a specified number of connections at one time to a given server. The default is two, but you can use the clientConnectionLimit attribute in an application configuration file to change the default.

This has been an issue for me; because there may be many users connected to the server at the same time so there must not be a limit on the number of connections at one time to the server.

Do you have any idea whether I should use TcpChannel or HttpChannel



Answer this question

HttpChannel or TcpChannel?

  • Blipwort

    Hi,

    The clientConnectionLimit attribute is a per client setting. It specifies how many connections each particular client can make to your server. So you could have 10 clients connected at the same time, and if clientConnectionLimit="2" then there would be a max of 20 conections.

    Regards TCP vs HTTP channels: you should defenetly opt out for TCP if performance matters to you. Given that you will be transfering files, and chances are that these files are larger in size, then go for TCP.

    On the other side, if the remotable object is hosted in IIS and acessable over HTTP, then you are free to consume all the scalability and extensebility of an ASP .NET application, something you would have limitted accesiblity to by using TCP.

    Hope that helps.



  • rickd24

    To add to stage88's reply, you'll want to use HTTP if you need get through firewalls and/or host in IIS. If those things aren't important to you, use TCP. Since you're sending large files, you may also want to consider using the binary formatter, regardless of whether you choose HTTP or TCP.

    Cheers,

    JJustice [MSFT]


  • HttpChannel or TcpChannel?