閱讀英文版本 編輯

分享方式:


SocketAsyncOperation Enum

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

The type of asynchronous socket operation most recently performed with this context object.

C#
public enum SocketAsyncOperation
Inheritance
SocketAsyncOperation

Fields

Name Value Description
None 0

None of the socket operations.

Accept 1

A socket Accept operation.

Connect 2

A socket Connect operation.

Disconnect 3

A socket Disconnect operation.

Receive 4

A socket Receive operation.

ReceiveFrom 5

A socket ReceiveFrom operation.

ReceiveMessageFrom 6

A socket ReceiveMessageFrom operation.

Send 7

A socket Send operation.

SendPackets 8

A socket SendPackets operation.

SendTo 9

A socket SendTo operation.

Remarks

This type describes the asynchronous socket operation that was most recently completed using a System.Net.Sockets.SocketAsyncEventArgs object. The value of the SocketAsyncEventArgs.LastOperation property is set to None until the System.Net.Sockets.SocketAsyncEventArgs instance is used to begin an asynchronous socket operation. The property will then be set to the type of asynchronous operation being performed. This type more easily facilitates using a single completion callback delegate for multiple kinds of asynchronous socket operations. This type is intended for use in the SocketAsyncCallback completion routine.

The SocketAsyncOperation type is used by the SocketAsyncEventArgs.LastOperation property.

Applies to

產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

See also