Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# DataWriter';s StoreAsync在StreamSocket下工作?_C#_Sockets_Windows Store Apps_Socketstream - Fatal编程技术网

C# DataWriter';s StoreAsync在StreamSocket下工作?

C# DataWriter';s StoreAsync在StreamSocket下工作?,c#,sockets,windows-store-apps,socketstream,C#,Sockets,Windows Store Apps,Socketstream,我正在Windows应用商店(8\Metro\RT)应用程序中创建套接字客户端(TCP),并尝试使用以下代码发送数据: await _socket.ConnectAsync(new HostName(ipAddress), port); _dataWriter = new DataWriter(_socket.OutputStream); _dataWriter.WriteBytes(bytes); await _dataWriter.StoreAsync(); //Does execution

我正在Windows应用商店(8\Metro\RT)应用程序中创建套接字客户端(TCP),并尝试使用以下代码发送数据:

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?

因此,问题就在注释中。

否。写入操作的完成只意味着数据已复制到操作系统缓冲区


当您收到数据的TCP ACK时,无法收到通知;但是,如果您没有得到一个(在内置TCP重试之后),那么您在套接字上执行的下一个操作将导致错误。

谢谢,我也这么认为。@TimBertalot:
FlushAsync
将刷新
缓冲区,将字节发送到网络层。它不会通过网络发送它们,也不会等待
ACK