Reputation: 3863
I need to send and receive a large image between programs running on different machines within the same network.
I've looked at using upd. However, I ran into problems with the size of the packets and (after breaking the image into smaller pieces to get past this problem) the number of packets needing to be processed all at once - and ultimately packet loss.
I've also thought of sending the image by storing it in a common file folder and receiving it by using file watcher as a trigger. However, this just adds further complexities in setup where common folders don't already exist.
Assuming I'm barking up the right tree looking at TCP, can someone point me to/provide an example of how to send an image file using it (VB.NET would be ideal). Also, are there practical limits to TCP package sizes?
If I am not barking up the right tree, and there is an easier way to do this I'd surely appreciate some guidance/examples.
Upvotes: 1
Views: 3368
Reputation: 6627
Consider using WCF (Windows Communication Foundation) with TCP binding. You can even use streaming mode. You don't need to worry about packet size, etc. You only need to be careful about the size of the image. You will need to modify some settings in the service configuration file to allow large messages to be sent.
You can make a proof-of-concept application within a day (no fancy UI, just the absolute minimum functionality). And that is because you are new to the technology. Someone that has worked with WCF beore can do it in about one hour at normal speed.
Upvotes: 0