flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
OzzY 14 Aug 2007, 20:56
Hello!
I want to create a simple file server and client. What's the best way to handle the data (and the size of the data) between the sockets? |
|||
![]() |
|
vid 14 Aug 2007, 23:19
best way is not simple
![]() |
|||
![]() |
|
r22 15 Aug 2007, 13:03
TransmitFile api efficiently sends files across a socket connection.
|
|||
![]() |
|
f0dder 15 Aug 2007, 14:30
TransmitFile has a limit on number of concurrent transfers, though, if you aren't running a server version of NT... and how would you keep a progress indicator updated with TransmitFile?
![]() |
|||
![]() |
|
r22 15 Aug 2007, 17:45
The SERVER end of a file server doesn't need to show progress information (i think a log with Tranfer Begin and Transfer End time stamps would probably be sufficient), just the clients, which would need to be sent the file size in advance, would show transfer progress.
As for the number of concurrent transfers, a limit on them would probably be best, you'd start bottlenecking on your HD with two or three concurrent reads on larger files. |
|||
![]() |
|
gunblade 15 Aug 2007, 21:58
I would have to agree with the TransmitFile suggestion. It's what i used in a small httpd i made for windows, and performance wise it seems to do the job damn well.
|
|||
![]() |
|
f0dder 16 Aug 2007, 12:55
It can be useful enough to be able to check completion status server-side - especially when dealing with large files. But again, it all really comes down to what you need.
TransmitFile has the obvious advantage of making "as few user<>kernel switches as possible", those are sorta expensive. Especially if you have a busy server with lots of clients. If I was coding a httpd server, I'd use it too - but possibly using something else for larger files, to have a bit more control. |
|||
![]() |
|
LocoDelAssembly 16 Aug 2007, 13:20
TransmitFile does not allow the server to implement byte ranges and hence, the server will not support resuming downloads.
|
|||
![]() |
|
f0dder 16 Aug 2007, 14:01
LocoDelAssembly: I think byte ranges could be implemented if you use the OVERLAPPED structure that TransmitFile takes as an arg?
|
|||
![]() |
|
LocoDelAssembly 16 Aug 2007, 14:42
Quote: You can use lpOverlapped to specify an offset within the file at which to start the file data transfer by setting the Offset and OffsetHigh member of the OVERLAPPED structure. If lpOverlapped is NULL, the transmission of data always starts at the current byte offset in the file. Yes ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.