3

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.

EgorBo
  • 6,120
  • 3
  • 35
  • 40

1 Answers1

4

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.

Stephen Cleary
  • 437,863
  • 77
  • 675
  • 810