开发者

TcpClient vs MSMQ

I'm developing an application that will need to communicate with itself running on different machines located in different locations. I was going to use TcpListener and TcpClient to send information between applications but then I came across MSMQ.

The computers are connected via software VPN, which communicates across my standard internet connection

Now I don't know which technology to use, TcpC开发者_StackOverflow社区lient or MSMQ.

I will want to send a different types of information requests and also transmit files. I have a large amount of data in a database which is too large to send across the internet to the application. So I want to send a request from one app to the other which will run a query, save the results to xml, compress it, and then send the file back. The receiving application will then decompress and load xml data set, hopefully saving a great amount of time. (Uncompressed this is about 10Mb+, compressed this is about 0.3Mb)

There will be different types of requests for information. So, I want my application to be able to differentiate between the requests, but I'm not sure how best to receive information and then determine what that information actually is, (i.e. what type of request it is)

Are the certain situations that one technology is better than the other?

Any pointers about how best to implement the scenario I've described will also be greatly, greatly appreciated!

Many, many thanks!


You might want to consider using Windows Communication Foundation instead of rolling your own solution.

It allows you to use TCP or MSMQ (or even Http/https) for your communication, and can be reconfigured as needed. It also makes handling the differentiation of message types easy - you can use standard .NET development techniques and not worry about the streaming, security, and other issues.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜