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.
파일 보기 프로젝트 열기: RocHCI/legion-gaming 1 사용 예제들

공개 메소드들

메소드 설명
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