Peter
Peter

Reputation: 38465

SocketAsyncEventArgs and ReadAsync

When using the "SocketAsyncEventArgs" class and ReadAsync, where do i put the read buffer and where do i put the send buffer? or can i only read or send at one time not both? I'm a bit confused.

Upvotes: 4

Views: 3881

Answers (3)

hultqvist
hultqvist

Reputation: 18429

You can only use a SocketAsyncEventArgs for a single operation at a time.

To both read and write async at the same time you'll need two SocketAsyncEventArgs objects.

Upvotes: 2

andyp
andyp

Reputation: 6269

I think you're looking for the Buffer property of SocketAsyncEventArgs. This tutorial explains how to use the SocketAsyncEventArgs class properly.

The MSDN article for the class contains some useful remarks and provides example code too (they're almost always a good start).

Upvotes: 5

Related Questions