|
Dreamine.Communication.Core 1.0.2
Dreamine.Communication.Core 통신 기능과 관련 API를 제공합니다.
|


클래스 | |
| class | FrameReadBuffer |
Public 멤버 함수 | |
| DelimiterMessageFrameCodec () | |
| DelimiterMessageFrameCodec (string delimiter, Encoding encoding, int maxFrameLength) | |
| async Task | WriteFrameAsync (Stream stream, byte[] payload, CancellationToken cancellationToken=default) |
| async Task< byte[]?> | ReadFrameAsync (Stream stream, CancellationToken cancellationToken=default) |
Private 멤버 함수 | |
| bool | TryConsumeBufferedBytes (FrameReadBuffer readBuffer, List< byte > frame, out byte[]? result) |
| bool | EndsWithDelimiter (List< byte > frame) |
Private 속성 | |
| readonly byte[] | _delimiter |
| readonly int | _maxFrameLength |
| readonly ConditionalWeakTable< Stream, FrameReadBuffer > | _readBuffers = new() |
지정한 바이트 구분자로 스트림의 메시지 경계를 구분합니다.
DelimiterMessageFrameCodec.cs 파일의 14 번째 라인에서 정의되었습니다.
|
inline |
CRLF, UTF-8 및 1MiB 제한을 사용하는 코덱을 초기화합니다.
DelimiterMessageFrameCodec.cs 파일의 52 번째 라인에서 정의되었습니다.
|
inline |
구분자, 인코딩 및 최대 프레임 길이를 지정하여 코덱을 초기화합니다.
| delimiter | 메시지 끝을 표시할 문자열입니다. |
| encoding | 구분자를 바이트로 변환할 인코딩입니다. |
| maxFrameLength | 구분자를 제외한 최대 프레임 바이트 수입니다. |
| ArgumentException | delimiter 가 비어 있는 경우 발생합니다. |
| ArgumentNullException | encoding 이 null인 경우 발생합니다. |
| ArgumentOutOfRangeException | maxFrameLength 가 0 이하인 경우 발생합니다. |
DelimiterMessageFrameCodec.cs 파일의 113 번째 라인에서 정의되었습니다.
다음을 참조함 : _delimiter, _maxFrameLength.
|
inlineprivate |
현재 프레임이 구성된 구분자 바이트로 끝나는지 확인합니다.
| frame | 끝부분을 검사할 프레임입니다. |
true입니다.DelimiterMessageFrameCodec.cs 파일의 402 번째 라인에서 정의되었습니다.
다음을 참조함 : _delimiter.
다음에 의해서 참조됨 : TryConsumeBufferedBytes().

|
inline |
구분자까지의 바이트를 하나의 프레임으로 비동기 읽습니다.
| stream | 읽을 스트림입니다. |
| cancellationToken | 읽기 취소 요청을 감시하는 토큰입니다. |
null입니다.| ArgumentNullException | stream 이 null인 경우 발생합니다. |
| InvalidDataException | 프레임이 최대 길이를 초과한 경우 발생합니다. |
| OperationCanceledException | 작업 취소가 요청된 경우 발생할 수 있습니다. |
Dreamine.Communication.Core.Framing.IMessageFrameCodec를 구현.
DelimiterMessageFrameCodec.cs 파일의 255 번째 라인에서 정의되었습니다.
다음을 참조함 : _maxFrameLength, _readBuffers, TryConsumeBufferedBytes().

|
inlineprivate |
스트림별 대기 버퍼의 바이트를 소비해 완전한 구분자 프레임 생성을 시도합니다.
| readBuffer | 아직 처리하지 않은 바이트가 저장된 버퍼입니다. |
| frame | 현재 조립 중인 프레임 바이트입니다. |
| result | 완성된 경우 구분자를 제외한 프레임이며, 아니면 null입니다. |
true입니다.| InvalidDataException | 프레임이 최대 허용 길이를 초과한 경우 발생합니다. |
DelimiterMessageFrameCodec.cs 파일의 342 번째 라인에서 정의되었습니다.
다음을 참조함 : _delimiter, _maxFrameLength, EndsWithDelimiter(), Dreamine.Communication.Core.Framing.DelimiterMessageFrameCodec.FrameReadBuffer.Pending, Dreamine.Communication.Core.Framing.DelimiterMessageFrameCodec.FrameReadBuffer.SyncRoot.
다음에 의해서 참조됨 : ReadFrameAsync().


|
inline |
페이로드와 구분자를 차례로 스트림에 비동기 기록합니다.
| stream | 기록할 스트림입니다. |
| payload | 구분자 앞에 기록할 메시지 데이터입니다. |
| cancellationToken | 쓰기 취소 요청을 감시하는 토큰입니다. |
| ArgumentNullException | 스트림 또는 페이로드가 null인 경우 발생합니다. |
| OperationCanceledException | 작업 취소가 요청된 경우 발생할 수 있습니다. |
Dreamine.Communication.Core.Framing.IMessageFrameCodec를 구현.
DelimiterMessageFrameCodec.cs 파일의 186 번째 라인에서 정의되었습니다.
다음을 참조함 : _delimiter.
|
private |
delimiter 값을 보관합니다.
DelimiterMessageFrameCodec.cs 파일의 24 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : DelimiterMessageFrameCodec(), EndsWithDelimiter(), TryConsumeBufferedBytes(), WriteFrameAsync().
|
private |
max Frame Length 값을 보관합니다.
DelimiterMessageFrameCodec.cs 파일의 33 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : DelimiterMessageFrameCodec(), ReadFrameAsync(), TryConsumeBufferedBytes().
|
private |
read Buffers 값을 보관합니다.
DelimiterMessageFrameCodec.cs 파일의 42 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : ReadFrameAsync().