Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

HJB8086

How to determine transfer speed?

This topic is 5761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, I''m using .net asynchrounous sockets and I don''t know how to determine the transfer speed, especially when sending data. For receiving data, what I do is, an asynchronous read returns the amount of bytes read so I divide that number by the amount of the seconds that have passed since the previous async read. For sending, it''s a bit harder though because sending data to the socket returns a void. so essentially, .net won''t notify me until all the data has been sent. When I do asynchronous reads from files on the HD, it tells me how much that has been read. Also, here''s the trade off. If I reuqest large reads (like 200KB+), the data gets sent pretty fast but if I choose small reads (8KB), I the asynch retuns faster but the transfer rate seems to suck. I was just curious how other programs do it, like AOL IM file transfer, Serv-U FTP, FTP VOyager, napters, kazaa, etc because I just can''t seem to determine transfer speeds properly.

Share this post


Link to post
Share on other sites
Advertisement
nm, I found out what my problem was. I was using the networkstream class instead of the socket class. Both asynch send and recive return the amount send/received. I guess that''s the trade off. NetworkSteam class is much easier to use and you let the framework handle the dirty work and using sockets is the exact opposite.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!