简体   繁体   中英

How does DataWriter's StoreAsync work under StreamSocket?

I am creating socket client (TCP) in Windows Store (8\\Metro\\RT) app and I am trying to send data using this code:

await _socket.ConnectAsync(new HostName(ipAddress), port);
_dataWriter = new DataWriter(_socket.OutputStream);
_dataWriter.WriteBytes(bytes);
await _dataWriter.StoreAsync();
//Does execution in this line mean that bytes were sent 
//and TCP packet acknowledge has been received?

so the question is in the comments.

No. The completion of a write operation only means that the data has been copied to an OS buffer.

There is no way to be notified when you get a TCP ACK for the data; however, if you do not get one (after the built-in TCP retries), then the next operation you do on the socket will result in an error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM