mikoil
August 25th, 2009, 09:39 PM
Hi!
Taken from
http://msdn.microsoft.com/en-us/library/ms742203%28VS.85%29.aspx
After reading the following two lines I'm a bit confused;
For a Winsock application, once the WSASend function is called, the system owns these buffers and the application may not access them. This array must remain valid for the duration of the send operation.
Data is copied from the buffer(s) into the transport's buffer.
See? The 2nd line tells me that the data is being copied to the transport's buffer, meaning, from what I understand, that the original buffer is free for manipulations.
On the other hand, the 1st line tells me that these buffer(s) that I've sent must be "valid", for the "duration of the send operation".
Define "valid" and "duration of the send operation"???
Again, if I understand right;
"valid" - Buffer cannot be allocated on the stack, otherwise when the function exits, this memory is no longer "valid". (variable scope).
"duration of the send operation" - Really not clear. Does this mean that I have to wait for the "write complete" completion port notification?
Please advise, thank you very much!
Taken from
http://msdn.microsoft.com/en-us/library/ms742203%28VS.85%29.aspx
After reading the following two lines I'm a bit confused;
For a Winsock application, once the WSASend function is called, the system owns these buffers and the application may not access them. This array must remain valid for the duration of the send operation.
Data is copied from the buffer(s) into the transport's buffer.
See? The 2nd line tells me that the data is being copied to the transport's buffer, meaning, from what I understand, that the original buffer is free for manipulations.
On the other hand, the 1st line tells me that these buffer(s) that I've sent must be "valid", for the "duration of the send operation".
Define "valid" and "duration of the send operation"???
Again, if I understand right;
"valid" - Buffer cannot be allocated on the stack, otherwise when the function exits, this memory is no longer "valid". (variable scope).
"duration of the send operation" - Really not clear. Does this mean that I have to wait for the "write complete" completion port notification?
Please advise, thank you very much!