2025-03-26 00:02:56 +08:00

58 lines
1.5 KiB
Markdown

#unity/日常积累
# Socket.EndReceive 方法
- 参考
反馈
[](https://learn.microsoft.com/zh-cn/dotnet/api/system.net.sockets.socket.endreceive?view=net-8.0#definition)
## 定义
命名空间:
[System.Net.Sockets](https://learn.microsoft.com/zh-cn/dotnet/api/system.net.sockets?view=net-8.0)
程序集:
System.Net.Sockets.dll
结束挂起的异步读取。
[](https://learn.microsoft.com/zh-cn/dotnet/api/system.net.sockets.socket.endreceive?view=net-8.0#--)
## 重载
[EndReceive(IAsyncResult)](https://learn.microsoft.com/zh-cn/dotnet/api/system.net.sockets.socket.endreceive?view=net-8.0#system-net-sockets-socket-endreceive(system-iasyncresult))
结束挂起的异步读取。
[EndReceive(IAsyncResult, SocketError)](https://learn.microsoft.com/zh-cn/dotnet/api/system.net.sockets.socket.endreceive?view=net-8.0#system-net-sockets-socket-endreceive(system-iasyncresult-system-net-sockets-socketerror@))
结束挂起的异步读取。
##
EndReceive(IAsyncResult)
结束挂起的异步读取。
``` cs
public int EndReceive (IAsyncResult asyncResult);
```
#### 参数
asyncResult
[IAsyncResult](https://learn.microsoft.com/zh-cn/dotnet/api/system.iasyncresult?view=net-8.0)
[IAsyncResult](https://learn.microsoft.com/zh-cn/dotnet/api/system.iasyncresult?view=net-8.0),它存储此异步操作的状态信息以及所有用户定义的数据。
#### 返回
[Int32](https://learn.microsoft.com/zh-cn/dotnet/api/system.int32?view=net-8.0)
收到的字节数。
![[Pasted image 20240415164708.png]]