sending files over TCP

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2008
Posts: 324
Reputation: Diamonddrake is a jewel in the rough Diamonddrake is a jewel in the rough Diamonddrake is a jewel in the rough 
Solved Threads: 39
Diamonddrake's Avatar
Diamonddrake Diamonddrake is offline Offline
Posting Whiz
 
0
  #21
Oct 11th, 2009
Ok, I kinda get what you are talking about, but Im not sure how to do that. your client

  1. private SendFileCompleteEventArgs SendFileWorker(string FileName)
  2. {
  3. SendFileCompleteEventArgs result = null;
  4.  
  5. using (FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
  6. {
  7. using (TcpClient cli = new TcpClient())
  8. {
  9. cli.Connect(this.endPoint);
  10. result = new SendFileCompleteEventArgs(FileName);
  11. result.Started = DateTime.Now;
  12.  
  13. using (NetworkStream ns = cli.GetStream())
  14. {
  15. StreamHelper.CopyStreamToStream(fs, ns, null);
  16. ns.Flush();
  17. ns.Close();
  18. }
  19. result.Completed = DateTime.Now;
  20. return result;
  21. }
  22. }
  23. }

Problem: I just can't see how to add your serialized data to that.

Problem: or even how to parse that on the otherside.

Im trying, this just really isn't my area. Also, I wouldn't mind using additional ports. as my desktop is the server for this, and working with firewalls and routers is simple.

This isn't going to be a mass used application, I intend to use it for 2 purposes. 1) to share files with a couple of my friends, and 2) to have a reliable way to send/get data to and from my desktop when I am not home.

again thanks for the help.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,211
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 572
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast
 
0
  #22
Oct 11th, 2009
No problem. I have exams coming up so it might be a few days before I can get back to you on this.
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 324
Reputation: Diamonddrake is a jewel in the rough Diamonddrake is a jewel in the rough Diamonddrake is a jewel in the rough 
Solved Threads: 39
Diamonddrake's Avatar
Diamonddrake Diamonddrake is offline Offline
Posting Whiz
 
0
  #23
Oct 11th, 2009
That's alright I am studding for the compTIA A+ exams myself. I will continue to attempt this and if I get any where with it I will post my results. Otherwise, when you get a chance, I would appreciate some more assistance. but if you don't get back to it I understand. you have been a big help.

Thanks again.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,211
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 572
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast
 
0
  #24
Oct 11th, 2009
Next monday fire up a new thread and upload the project you have so far and we'll go from there.

Good luck on your exam!
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Reply

Tags
networking, sockets, tcp

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC