C# Класс GamingInterface.BufferManager

This class creates a single large buffer which can be divided up and assigned to SocketAsyncEventArgs objects for use with each socket I/O operation. This enables bufffers to be easily reused and gaurds against fragmenting heap memory. The operations exposed on the BufferManager class are not thread safe.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BufferManager ( int totalBytes, int bufferSize ) : System
FreeBuffer ( SocketAsyncEventArgs args ) : void

Removes the buffer from a SocketAsyncEventArg object. This frees the buffer back to the buffer pool

InitBuffer ( ) : void

Allocates buffer space used by the buffer pool

SetBuffer ( SocketAsyncEventArgs args ) : bool

Assigns a buffer from the buffer pool to the specified SocketAsyncEventArgs object

Описание методов

BufferManager() публичный Метод

public BufferManager ( int totalBytes, int bufferSize ) : System
totalBytes int
bufferSize int
Результат System

FreeBuffer() публичный Метод

Removes the buffer from a SocketAsyncEventArg object. This frees the buffer back to the buffer pool
public FreeBuffer ( SocketAsyncEventArgs args ) : void
args System.Net.Sockets.SocketAsyncEventArgs
Результат void

InitBuffer() публичный Метод

Allocates buffer space used by the buffer pool
public InitBuffer ( ) : void
Результат void

SetBuffer() публичный Метод

Assigns a buffer from the buffer pool to the specified SocketAsyncEventArgs object
public SetBuffer ( SocketAsyncEventArgs args ) : bool
args System.Net.Sockets.SocketAsyncEventArgs
Результат bool