Reputation: 2613
I'm trying to make a P2P application with WCF and so far it seems simple enough and I've managed to send simple string messages but that's about it. I'd like to send files in the same manner, but I can't find any useful tutorials on it. All I find is different ways to build chat applications. Are there any useful resources on how to send files in a P2P mesh?
Currently I'm going off of a slightly modified version of this. I've found a similar example on how to send and retrieve files from a server with WCF, but I don't know if it's in any way compatible with the structure I already have since it uses a different binding.
Upvotes: 1
Views: 1872
Reputation: 65431
The file transfer example that you link to uses streaming
There are only 4 bindings that support streaming, unfortunatly the peer binding that you are using is not among them.
What you can do is to create a WCF contract that has 2 properties, file_name and file_contents. The file name is a string and the file contents is a byte array. Then you can convert the file to a byte array and send it over the same way as you send over a string.
Upvotes: 1