Reputation: 6749
When you have a network path open in Windows explorer, and you drag it to a local folder does it open a socket? Also, when you use c# FileStream fin = new FileStream(@"//networkpath/file); does that open a socked? my question is this, would it be just as fast to stream a file over a socket manually as it would be to read it over a network using c#'s filestream?
Upvotes: 0
Views: 1462
Reputation: 61396
The Windows file service works over TCP/IP by default (although not necessarily), so typically, there's a socket involved. Yes, there's some overhead from the SMB protocol that Windows uses. However, for files where transfer time matters, the overhead is small compared to the data.
In addition, coming up with your own file sharing protocol without a very good reason is a bad idea. It's a lot of development and debugging work, you have to install the server part somehow, you have to think of security implications (user authentication, etc), firewalls will break it... Just not worth it.
To gauge the amount of work involved, read the description of the FTP protocol.
Upvotes: 3