iconDreamine
← 목록

Dreamine.Communication.Core

stablev1.0.2

통신 코어 구현 — 연결 관리, 재연결, 메시지 라우팅.

#communication#core#dreamine#framing#messagebus#messaging#routing#serialization
TFM net8.0Package Dreamine.Communication.Core참조 Dreamine.Communication.Abstractions

Dreamine.Communication.Core

Dreamine.Communication.Core는 Dreamine Communication 계열 패키지의 일부입니다.

이 패키지는 구체 통신 어댑터들이 공통으로 사용하는 런타임 계층을 제공합니다. TCP, Serial, RabbitMQ, WPF를 직접 구현하지 않습니다. 구체 Transport는 이 패키지에 의존하고, Protocol Adapter와 Frame Codec을 조합해서 사용합니다.

➡️ English Version

설명

Dreamine Communication을 위한 Core MessageBus, Routing, Serialization, Protocol Adapter, Message Framing, Transport-to-MessageBus Adapter 유틸리티를 제공합니다.

패키지 역할

Dreamine.Communication.Abstractions
    ↑
Dreamine.Communication.Core
    ↑
Sockets / Serial / RabbitMQ / WPF

Core는 Transport와 독립적인 규칙을 담당합니다.

  • MessageEnvelope를 직렬화하는 방법
  • 외부 Payload를 MessageEnvelope로 변환하는 방법
  • 바이트 스트림에서 메시지 경계를 나누는 방법
  • 애플리케이션 내부에서 메시지를 라우팅하거나 발행하는 방법

Socket 연결, Serial Port 연결, RabbitMQ 연결, WPF UI 로직은 Core의 책임이 아닙니다.

주요 기능

  • 메모리 기반 메시지 버스
  • 메시지 Route Dispatcher
  • MessageEnvelope JSON 직렬화
  • 내부/외부 Payload 형식 변환을 위한 Protocol Adapter
  • TCP 같은 바이트 스트림을 위한 Frame Codec
  • Transport-to-MessageBus 어댑터

주요 구성 요소

Message Bus

타입 역할
InMemoryMessageBus 프로세스 내부 Publish/Subscribe 메시지 버스입니다.
TransportMessageBusAdapter IMessageTransportIMessageBus처럼 사용할 수 있게 감싸는 어댑터입니다.

Routing

타입 역할
MessageRouter Route 기준으로 Handler를 등록하고 MessageEnvelope를 Dispatch합니다.
MessageHandlerRegistration Handler 등록 메타데이터를 표현합니다.

Serialization

타입 역할
JsonMessageSerializer System.Text.Json 기반으로 MessageEnvelope를 직렬화/역직렬화합니다.

Protocol Adapters

Protocol Adapter는 원시 Payload 바이트와 Dreamine MessageEnvelope 사이의 변환을 담당합니다.

타입 사용 목적
DreamineEnvelopeProtocolAdapter Dreamine 내부 표준 형식입니다. 전체 MessageEnvelope JSON을 Encode/Decode합니다.
PlainTextProtocolAdapter 외부 일반 문자열 통신용입니다. 문자열 바이트를 MessageEnvelope로 감쌉니다.
RawJsonProtocolAdapter Dreamine 고정 스키마가 없는 외부 JSON 통신용입니다. Raw JSON을 MessageEnvelope로 감쌉니다.

Frame Codecs

Frame Codec은 바이트 스트림에서 메시지 경계를 판단하는 규칙입니다.

타입 경계 판단 방식 권장 용도
LengthPrefixedMessageFrameCodec 4바이트 Big-Endian 길이 Prefix를 사용합니다. Dreamine 내부 통신, 안정적인 Binary-safe 프로토콜
DelimiterMessageFrameCodec \r\n 같은 Delimiter가 나올 때까지 읽습니다. Line Ending을 보내는 외부 장비/툴 문자열 통신
RawAvailableMessageFrameCodec 현재 수신된 바이트를 즉시 하나의 메시지로 처리합니다. Hercules, 임시 테스트, CRLF나 길이 Prefix 없이 단순 문자열을 보내는 외부 툴

Frame Codec 선택 기준

상황 권장 Codec 이유
Dreamine ↔ Dreamine 통신 LengthPrefixedMessageFrameCodec 메시지 경계를 정확히 보존하고 임의 Payload를 안전하게 처리합니다.
CRLF 또는 LF로 끝나는 문자열 프로토콜 DelimiterMessageFrameCodec Line 기반 프로토콜과 맞습니다.
Hercules에서 test1만 보내고 CRLF가 없음 RawAvailableMessageFrameCodec Delimiter를 기다리지 않고 즉시 Receive 처리할 수 있습니다.
CRLF로 끝나는 Raw JSON DelimiterMessageFrameCodec + RawJsonProtocolAdapter JSON Payload를 그대로 유지하면서 메시지 경계도 보존합니다.

RawAvailableMessageFrameCodec

RawAvailableMessageFrameCodec은 단순 Raw Byte 수신 상황을 위한 호환용 Codec입니다. 내부 Stream Read에서 반환된 바이트를 즉시 하나의 Frame으로 반환합니다.

다음처럼 외부 툴이 단순 문자열만 보내는 경우에 유용합니다.

test1

이때 아래 요소가 없어도 Receive 처리가 가능합니다.

  • Length Prefix
  • CRLF
  • LF
  • 고정 JSON Envelope

사용 예시:

using System.Text;
using Dreamine.Communication.Core.Framing;
using Dreamine.Communication.Core.Protocols;
using Dreamine.Communication.Sockets.Options;
using Dreamine.Communication.Sockets.Servers;

var server = new TcpServerTransport(
    new TcpServerTransportOptions
    {
        Host = "127.0.0.1",
        Port = 15002
    },
    new PlainTextProtocolAdapter(
        Encoding.UTF8,
        "tcp.raw.available",
        "Tcp.RawAvailable"),
    new RawAvailableMessageFrameCodec());

server.MessageReceived += (_, message) =>
{
    var text = Encoding.UTF8.GetString(message.Payload);
    Console.WriteLine($"RX: {text}");
};

await server.ConnectAsync();

TCP 주의 사항

TCP는 Message Protocol이 아니라 Stream Protocol입니다. RawAvailableMessageFrameCodec은 의도적으로 허용적인 방식이지만, 애플리케이션 레벨의 메시지 경계를 보장하지 않습니다.

예를 들어 빠르게 두 번 보낸 데이터가 다음처럼 합쳐질 수 있습니다.

test1test2

또는 한 번 보낸 데이터가 다음처럼 쪼개질 수도 있습니다.

te
st1

따라서 RawAvailableMessageFrameCodec은 호환성, 디버깅, 임시 테스트, Framing을 제공하지 않는 외부 툴 대응용으로만 사용하는 것이 좋습니다. 운영 프로토콜에는 LengthPrefixedMessageFrameCodec 또는 DelimiterMessageFrameCodec을 우선 권장합니다.

권장 Protocol 조합

Mode Protocol Adapter Frame Codec
Dreamine Envelope DreamineEnvelopeProtocolAdapter LengthPrefixedMessageFrameCodec
Plain Text Line Protocol PlainTextProtocolAdapter DelimiterMessageFrameCodec
Plain Text Raw Receive PlainTextProtocolAdapter RawAvailableMessageFrameCodec
Raw JSON Line Protocol RawJsonProtocolAdapter DelimiterMessageFrameCodec

설계 원칙

  • 구체 Transport 구현체를 상위 레이어와 분리합니다.
  • Dreamine.Communication.Abstractions의 계약에 의존합니다.
  • 패키지 책임을 작고 명확하게 유지합니다.
  • 단방향 의존성 흐름을 유지합니다.
  • Payload Protocol 변환과 Stream Frame 검출을 분리합니다.
  • 향후 Adapter와 Codec을 추가해도 애플리케이션 로직을 변경하지 않도록 합니다.

의존성

  • Dreamine.Communication.Abstractions

대상 프레임워크

net8.0

관련 패키지

  • Dreamine.Communication.Abstractions
  • Dreamine.Communication.Core
  • Dreamine.Communication.Sockets
  • Dreamine.Communication.Serial
  • Dreamine.Communication.RabbitMQ
  • Dreamine.Communication.FullKit
  • Dreamine.Communication.Wpf

Text Encoding 정책

Text Encoding은 외부 Raw Byte를 MessageEnvelope로 변환하거나, MessageEnvelope의 Payload를 다시 외부 Byte로 변환하는 Protocol Adapter 경계에서 처리합니다.

Encoding 옵션은 외부 바이트 기반 통신에 적용됩니다.

  • TCP
  • UDP
  • Serial

PlainTextProtocolAdapterRawJsonProtocolAdapter는 UTF-8 또는 CP949 같은 외부 Text Encoding을 설정할 수 있습니다. 현대 시스템 간 통신에는 UTF-8을 권장합니다. CP949는 레거시 Windows 툴, 한글 장비, UTF-8을 보내지 않는 테스트 툴과 연동할 때 사용할 수 있습니다.

InMemoryMessageBus는 같은 프로세스 안에서 MessageEnvelope 객체를 직접 전달하므로 Text Encoding이 필요하지 않습니다. RabbitMQ도 기본 Dreamine 흐름에서는 MessageEnvelope를 UTF-8 JSON으로 직렬화하므로 별도 Encoding 옵션을 노출하지 않습니다.

라이선스

이 프로젝트는 MIT 라이선스를 따릅니다.

구조 다이어그램

classDiagram
    class ConnectionClientBase {
        <<abstract>>
        #string _host
        #int _port
        +IsConnected bool
        +ConnectAsync() Task
        +DisconnectAsync() Task
        #OnConnected() void
        #OnDisconnected() void
        #SendBytesAsync(byte[]) Task
        #ReceiveBytesAsync() Task~byte[]~
    }
    class MessageClientBase~T~ {
        <<abstract>>
        +SendAsync(T) Task
        +MessageReceived event
        #DeserializeMessage(byte[]) T
        #SerializeMessage(T) byte[]
    }
    class ReconnectPolicy {
        +int MaxRetries
        +TimeSpan Delay
        +bool Exponential
        +ShouldRetry(int) bool
        +GetDelay(int) TimeSpan
    }
    class IConnectionClient {
        <<interface>>
    }
    IConnectionClient <|.. ConnectionClientBase
    ConnectionClientBase <|-- MessageClientBase~T~
    ConnectionClientBase --> ReconnectPolicy

API 문서

타입

DelimiterMessageFrameCodec

\if KO 지정한 바이트 구분자로 스트림의 메시지 경계를 구분합니다. \endif \if EN Delimits message boundaries in a stream using a configured byte delimiter. \endif

DreamineEnvelopeProtocolAdapter

\if KO Dreamine 표준 메시지 봉투와 JSON 바이트 간 변환을 수행합니다. \endif \if EN Converts between Dreamine-standard message envelopes and JSON bytes. \endif

FrameReadBuffer

\if KO 스트림별로 아직 프레임으로 완성되지 않은 바이트와 동기화 객체를 보관합니다. \endif \if EN Stores synchronization state and bytes that have not yet formed a complete frame for a stream. \endif

IMessageFrameCodec

\if KO 바이트 스트림에서 완전한 메시지 프레임을 읽고 쓰는 계약입니다. \endif \if EN Defines how complete message frames are read from and written to a byte stream. \endif

InMemoryMessageBus

\if KO 프로세스 메모리 안에서 라우트별 메시지를 발행하고 구독하는 메시지 버스입니다. \endif \if EN Provides route-based message publishing and subscription within the current process. \endif

InMemoryOutboundMessageQueue

\if KO 연결이 끊긴 동안 송신 대기 메시지를 메모리에 순서대로 보관합니다. \endif \if EN Stores pending outbound messages in memory in queue order while disconnected. \endif

IOutboundMessageQueue

\if KO 연결이 끊긴 동안 송신 메시지를 보관하고 다시 꺼내는 큐 계약입니다. \endif \if EN Defines a queue that retains and retrieves outbound messages while disconnected. \endif

JsonMessageSerializer

\if KO 를 사용해 메시지 봉투를 UTF-8 JSON으로 변환합니다. \endif \if EN Converts message envelopes to and from UTF-8 JSON using . \endif

LengthPrefixedMessageFrameCodec

\if KO 4바이트 빅 엔디언 길이 접두사로 메시지 프레임을 구분합니다. \endif \if EN Frames messages with a four-byte big-endian length prefix. \endif

MessageEnvelopeExtensions

\if KO 생성과 페이로드 변환을 위한 편의 기능을 제공합니다. \endif \if EN Provides convenience methods for creating message envelopes and converting their payloads. \endif

MessageHandlerRegistration

\if KO 메시지 라우트와 비동기 처리기를 하나의 등록 정보로 묶습니다. \endif \if EN Associates a message route with an asynchronous message handler. \endif

MessageRouter

\if KO 메시지 라우트별로 등록된 비동기 처리기를 실행하는 기본 라우터입니다. \endif \if EN Provides a default router that invokes asynchronous handlers registered by message route. \endif

PlainTextProtocolAdapter

\if KO 외부 일반 텍스트 데이터와 Dreamine 메시지 봉투를 상호 변환합니다. \endif \if EN Converts between external plain-text data and Dreamine message envelopes. \endif

PlainTextProtocolOptions

\if KO 일반 텍스트 프로토콜 어댑터의 인코딩과 메시지 메타데이터를 구성합니다. \endif \if EN Configures encoding and message metadata for the plain-text protocol adapter. \endif

QueuedOutboundMessage

\if KO 연결이 끊긴 동안 큐에 보관되는 송신 대기 메시지와 재시도 상태를 나타냅니다. \endif \if EN Represents a pending outbound message and its retry state while disconnected. \endif

RawAvailableMessageFrameCodec

\if KO 현재 수신 가능한 바이트를 즉시 하나의 원시 메시지 프레임으로 처리합니다. \endif \if EN Treats the bytes currently available for reading as one raw message frame. \endif

RawJsonProtocolAdapter

\if KO 고정 스키마가 없는 외부 JSON을 Dreamine 메시지 봉투로 감싸고 다시 송신 데이터로 변환합니다. \endif \if EN Wraps schema-free external JSON in Dreamine message envelopes and converts it back for transmission. \endif

RawJsonProtocolOptions

\if KO 원시 JSON 프로토콜 어댑터의 인코딩과 기본 메시지 메타데이터를 구성합니다. \endif \if EN Configures encoding and default message metadata for the raw JSON protocol adapter. \endif

ReconnectDelayCalculator

\if KO 재연결 정책의 지수 백오프 설정으로 재시도 대기 시간을 계산합니다. \endif \if EN Calculates retry delays from the exponential-backoff settings of a reconnection policy. \endif

ResilientMessageTransport

\if KO 내부 메시지 전송 계층에 자동 재연결, 지수 백오프 및 연결 끊김 송신 큐를 추가합니다. \endif \if EN Adds automatic reconnection, exponential backoff, and disconnected-send queueing to an inner message transport. \endif

TransportMessageBusAdapter

\if KO 메시지 전송 계층을 발행·구독 메시지 버스로 사용할 수 있게 변환합니다. \endif \if EN Adapts a message transport for use as a publish-subscribe message bus. \endif

DelimiterMessageFrameCodec

#ctor Method

\if KO CRLF, UTF-8 및 1MiB 제한을 사용하는 코덱을 초기화합니다. \endif \if EN Initializes a codec using CRLF, UTF-8, and a 1 MiB limit. \endif

#ctor Method

\if KO 구분자, 인코딩 및 최대 프레임 길이를 지정하여 코덱을 초기화합니다. \endif \if EN Initializes the codec with a delimiter, encoding, and maximum frame length. \endif

delimiter— \if KO 메시지 끝을 표시할 문자열입니다. \endif \if EN The string that marks the end of a message. \endif
encoding— \if KO 구분자를 바이트로 변환할 인코딩입니다. \endif \if EN The encoding used to convert the delimiter to bytes. \endif
maxFrameLength— \if KO 구분자를 제외한 최대 프레임 바이트 수입니다. \endif \if EN The maximum frame size in bytes, excluding the delimiter. \endif
EndsWithDelimiter Method

\if KO 현재 프레임이 구성된 구분자 바이트로 끝나는지 확인합니다. \endif \if EN Determines whether the current frame ends with the configured delimiter bytes. \endif

frame— \if KO 끝부분을 검사할 프레임입니다. \endif \if EN The frame whose ending is inspected. \endif

반환: \if KO 구분자로 끝나면 입니다. \endif \if EN when the frame ends with the delimiter. \endif

ReadFrameAsync Method

\if KO 구분자까지의 바이트를 하나의 프레임으로 비동기 읽습니다. \endif \if EN Asynchronously reads bytes through the next delimiter as one frame. \endif

stream— \if KO 읽을 스트림입니다. \endif \if EN The source stream. \endif
cancellationToken— \if KO 읽기 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe read cancellation. \endif

반환: \if KO 구분자를 제외한 프레임이며, 데이터 없이 스트림이 끝나면 입니다. \endif \if EN The frame without its delimiter, or when the stream ends without data. \endif

TryConsumeBufferedBytes Method

\if KO 스트림별 대기 버퍼의 바이트를 소비해 완전한 구분자 프레임 생성을 시도합니다. \endif \if EN Consumes bytes from a per-stream pending buffer and attempts to produce a complete delimited frame. \endif

readBuffer— \if KO 아직 처리하지 않은 바이트가 저장된 버퍼입니다. \endif \if EN The buffer containing bytes not yet processed. \endif
frame— \if KO 현재 조립 중인 프레임 바이트입니다. \endif \if EN The frame bytes currently being assembled. \endif
result— \if KO 완성된 경우 구분자를 제외한 프레임이며, 아니면 입니다. \endif \if EN The completed frame without its delimiter, or when incomplete. \endif

반환: \if KO 완전한 프레임을 만들었으면 입니다. \endif \if EN when a complete frame was produced. \endif

WriteFrameAsync Method

\if KO 페이로드와 구분자를 차례로 스트림에 비동기 기록합니다. \endif \if EN Asynchronously writes the payload followed by the delimiter. \endif

stream— \if KO 기록할 스트림입니다. \endif \if EN The destination stream. \endif
payload— \if KO 구분자 앞에 기록할 메시지 데이터입니다. \endif \if EN The message data written before the delimiter. \endif
cancellationToken— \if KO 쓰기 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe write cancellation. \endif

반환: \if KO 비동기 프레임 쓰기 작업입니다. \endif \if EN A task representing the asynchronous frame write. \endif

_delimiter Field

\if KO delimiter 값을 보관합니다. \endif \if EN Stores the delimiter value. \endif

_maxFrameLength Field

\if KO max Frame Length 값을 보관합니다. \endif \if EN Stores the max frame length value. \endif

_readBuffers Field

\if KO read Buffers 값을 보관합니다. \endif \if EN Stores the read buffers value. \endif

DreamineEnvelopeProtocolAdapter

#ctor Method

\if KO 기본 JSON 직렬화기로 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with the default JSON serializer. \endif

#ctor Method

\if KO 지정한 메시지 직렬화기로 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with the specified message serializer. \endif

serializer— \if KO 메시지 봉투를 변환할 직렬화기입니다. \endif \if EN The serializer used to convert message envelopes. \endif
Decode Method

\if KO Dreamine 메시지 봉투 JSON을 내부 메시지로 역직렬화합니다. \endif \if EN Deserializes Dreamine message-envelope JSON into an internal message. \endif

payload— \if KO 수신한 메시지 봉투 JSON 바이트입니다. \endif \if EN The received message-envelope JSON bytes. \endif

반환: \if KO 역직렬화된 Dreamine 표준 메시지입니다. \endif \if EN The deserialized Dreamine-standard message. \endif

Encode Method

\if KO 내부 메시지를 Dreamine 표준 JSON 바이트로 직렬화합니다. \endif \if EN Serializes an internal message to Dreamine-standard JSON bytes. \endif

message— \if KO 직렬화할 메시지입니다. \endif \if EN The message to serialize. \endif

반환: \if KO 송신할 Dreamine 표준 JSON 바이트입니다. \endif \if EN Dreamine-standard JSON bytes ready for transmission. \endif

_serializer Field

\if KO serializer 값을 보관합니다. \endif \if EN Stores the serializer value. \endif

FrameReadBuffer

Pending Property

\if KO 다음 프레임 해석에서 이어서 처리할 수신 바이트 큐를 가져옵니다. \endif \if EN Gets the received-byte queue to resume processing during the next frame decode. \endif

SyncRoot Property

\if KO 대기 바이트 큐에 대한 동시 접근을 직렬화하는 동기화 객체를 가져옵니다. \endif \if EN Gets the synchronization object that serializes access to the pending-byte queue. \endif

IMessageFrameCodec

ReadFrameAsync Method

\if KO 스트림에서 하나의 완전한 메시지 프레임을 비동기적으로 읽습니다. \endif \if EN Asynchronously reads one complete message frame from a stream. \endif

stream— \if KO 프레임을 읽을 읽기 가능한 스트림입니다. \endif \if EN The readable stream from which the frame is read. \endif
cancellationToken— \if KO 비동기 읽기 작업의 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the asynchronous read. \endif

반환: \if KO 프레임에서 추출한 메시지 데이터이며, 데이터 없이 스트림이 끝나면 입니다. \endif \if EN The message data extracted from the frame, or when the stream ends without data. \endif

WriteFrameAsync Method

\if KO 하나의 메시지 페이로드를 프레임 형식으로 스트림에 비동기 기록합니다. \endif \if EN Asynchronously writes one message payload to a stream using the codec's frame format. \endif

stream— \if KO 프레임을 기록할 쓰기 가능한 스트림입니다. \endif \if EN The writable stream to which the frame is written. \endif
payload— \if KO 프레임에 포함할 메시지 데이터입니다. \endif \if EN The message data to include in the frame. \endif
cancellationToken— \if KO 비동기 쓰기 작업의 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the asynchronous write. \endif

반환: \if KO 비동기 프레임 쓰기 작업입니다. \endif \if EN A task that represents the asynchronous frame write. \endif

InMemoryMessageBus

ConnectAsync Method

\if KO 메모리 메시지 버스를 연결 상태로 전환합니다. \endif \if EN Transitions the in-memory message bus to the connected state. \endif

cancellationToken— \if KO 연결 작업 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the connection operation. \endif

반환: \if KO 완료된 비동기 연결 작업입니다. \endif \if EN A completed task representing the connection operation. \endif

DisconnectAsync Method

\if KO 메모리 메시지 버스를 연결 해제 상태로 전환합니다. \endif \if EN Transitions the in-memory message bus to the disconnected state. \endif

cancellationToken— \if KO 연결 해제 작업 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the disconnection operation. \endif

반환: \if KO 완료된 비동기 연결 해제 작업입니다. \endif \if EN A completed task representing the disconnection operation. \endif

DisposeAsync Method

\if KO 등록된 처리기를 제거하고 버스를 연결 해제 상태로 전환합니다. \endif \if EN Clears registered handlers and transitions the bus to the disconnected state. \endif \if KO 완료된 비동기 해제 작업입니다. \endif \if EN A completed value task representing asynchronous disposal. \endif

PublishAsync Method

\if KO 메시지 라우트에 등록된 모든 처리기에 메시지를 비동기적으로 발행합니다. \endif \if EN Asynchronously publishes a message to every handler registered for its route. \endif

message— \if KO 발행할 메시지입니다. \endif \if EN The message to publish. \endif
cancellationToken— \if KO 처리기 실행 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel handler execution. \endif

반환: \if KO 등록된 처리기의 비동기 실행 작업입니다. \endif \if EN A task representing asynchronous execution of the registered handlers. \endif

SubscribeAsync Method

\if KO 지정한 라우트에 비동기 메시지 처리기를 등록합니다. \endif \if EN Registers an asynchronous message handler for the specified route. \endif

route— \if KO 구독할 메시지 라우트입니다. \endif \if EN The message route to subscribe to. \endif
handler— \if KO 수신 메시지를 처리할 비동기 대리자입니다. \endif \if EN The asynchronous delegate that processes received messages. \endif
cancellationToken— \if KO 구독 작업 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the subscription operation. \endif

반환: \if KO 완료된 비동기 구독 작업입니다. \endif \if EN A completed task representing the subscription operation. \endif

Kind Property

\if KO 메모리 내부 전송 방식을 가져옵니다. \endif \if EN Gets the in-memory transport kind. \endif

State Property

\if KO 메시지 버스의 현재 연결 상태를 가져옵니다. \endif \if EN Gets the current connection state of the message bus. \endif

_handlers Field

\if KO handlers 값을 보관합니다. \endif \if EN Stores the handlers value. \endif

InMemoryOutboundMessageQueue

#ctor Method

\if KO 지정한 용량 및 초과 처리 설정으로 메모리 큐를 초기화합니다. \endif \if EN Initializes the in-memory queue with capacity and overflow settings. \endif

options— \if KO 큐 용량과 초과 처리 설정입니다. 이면 기본값을 사용합니다. \endif \if EN The capacity and overflow settings; uses defaults. \endif
Clear Method

\if KO 큐에 저장된 모든 메시지를 스레드 안전하게 제거합니다. \endif \if EN Removes all queued messages in a thread-safe manner. \endif

EnqueueAsync Method

\if KO 메시지를 큐 뒤쪽에 추가하며, 설정에 따라 가득 찬 큐의 가장 오래된 항목을 제거합니다. \endif \if EN Adds a message to the back, optionally dropping the oldest item when full. \endif

message— \if KO 저장할 송신 대기 메시지입니다. \endif \if EN The pending outbound message to store. \endif
cancellationToken— \if KO 추가 작업 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel enqueueing. \endif

반환: \if KO 완료된 비동기 추가 작업입니다. \endif \if EN A completed value task representing enqueueing. \endif

EnqueueFrontAsync Method

\if KO 재시도할 메시지를 큐 앞쪽에 다시 추가하며 필요하면 뒤쪽 항목을 제거합니다. \endif \if EN Returns a retry message to the front, dropping a back item when configured and necessary. \endif

message— \if KO 큐 앞쪽에 다시 저장할 메시지입니다. \endif \if EN The message to return to the front. \endif
cancellationToken— \if KO 추가 작업 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel enqueueing. \endif

반환: \if KO 완료된 비동기 앞쪽 추가 작업입니다. \endif \if EN A completed value task representing front-enqueueing. \endif

EnsureCapacityForAddToBack Method

\if KO 큐 뒤쪽에 항목을 추가할 공간을 확보하고 설정에 따라 가장 오래된 항목을 제거합니다. \endif \if EN Ensures capacity for a back insertion, dropping the oldest item when configured. \endif

EnsureCapacityForAddToFront Method

\if KO 큐 앞쪽에 항목을 추가할 공간을 확보하고 설정에 따라 가장 최근 항목을 제거합니다. \endif \if EN Ensures capacity for a front insertion, dropping the newest item when configured. \endif

TryDequeueAsync Method

\if KO 큐에서 가장 오래된 메시지를 제거해 반환합니다. \endif \if EN Removes and returns the oldest queued message. \endif

cancellationToken— \if KO 꺼내기 작업 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel dequeueing. \endif

반환: \if KO 제거한 메시지이며, 큐가 비어 있으면 입니다. \endif \if EN The removed message, or when empty. \endif

Count Property

\if KO 현재 큐에 저장된 메시지 수를 스레드 안전하게 가져옵니다. \endif \if EN Gets the number of queued messages in a thread-safe manner. \endif

_messages Field

\if KO messages 값을 보관합니다. \endif \if EN Stores the messages value. \endif

_options Field

\if KO options 값을 보관합니다. \endif \if EN Stores the options value. \endif

_sync Field

\if KO sync 값을 보관합니다. \endif \if EN Stores the sync value. \endif

IOutboundMessageQueue

Clear Method

\if KO 큐에 저장된 모든 메시지를 제거합니다. \endif \if EN Removes all messages stored in the queue. \endif

EnqueueAsync Method

\if KO 메시지를 큐의 뒤쪽에 비동기적으로 추가합니다. \endif \if EN Asynchronously adds a message to the back of the queue. \endif

message— \if KO 큐에 저장할 송신 대기 메시지입니다. \endif \if EN The pending outbound message to store. \endif
cancellationToken— \if KO 추가 작업의 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the enqueue operation. \endif

반환: \if KO 비동기 추가 작업입니다. \endif \if EN A value task that represents the asynchronous enqueue operation. \endif

EnqueueFrontAsync Method

\if KO 재시도할 메시지를 큐의 앞쪽에 비동기적으로 다시 추가합니다. \endif \if EN Asynchronously returns a message to the front of the queue for retry. \endif

message— \if KO 큐 앞쪽에 다시 저장할 메시지입니다. \endif \if EN The message to return to the front of the queue. \endif
cancellationToken— \if KO 추가 작업의 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the enqueue operation. \endif

반환: \if KO 비동기 앞쪽 추가 작업입니다. \endif \if EN A value task that represents the asynchronous front-enqueue operation. \endif

TryDequeueAsync Method

\if KO 큐에서 가장 오래된 메시지를 비동기적으로 제거해 반환합니다. \endif \if EN Asynchronously removes and returns the oldest message in the queue. \endif

cancellationToken— \if KO 꺼내기 작업의 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the dequeue operation. \endif

반환: \if KO 제거한 메시지이며, 큐가 비어 있으면 입니다. \endif \if EN The removed message, or when the queue is empty. \endif

Count Property

\if KO 현재 큐에 저장된 메시지 수를 가져옵니다. \endif \if EN Gets the number of messages currently stored in the queue. \endif

JsonMessageSerializer

#ctor Method

\if KO 대소문자를 구분하지 않는 기본 JSON 옵션으로 직렬화기를 초기화합니다. \endif \if EN Initializes the serializer with default case-insensitive JSON options. \endif

#ctor Method

\if KO 지정한 JSON 옵션으로 직렬화기를 초기화합니다. \endif \if EN Initializes the serializer with the specified JSON options. \endif

options— \if KO 직렬화와 역직렬화에 사용할 옵션입니다. \endif \if EN The options used for serialization and deserialization. \endif
Deserialize Method

\if KO UTF-8 JSON 바이트를 메시지로 역직렬화합니다. \endif \if EN Deserializes UTF-8 JSON bytes into a message. \endif

data— \if KO 역직렬화할 UTF-8 JSON 바이트입니다. \endif \if EN The UTF-8 JSON bytes to deserialize. \endif

반환: \if KO 역직렬화된 메시지입니다. \endif \if EN The deserialized message. \endif

Serialize Method

\if KO 메시지를 UTF-8 JSON 바이트 배열로 직렬화합니다. \endif \if EN Serializes a message to a UTF-8 JSON byte array. \endif

message— \if KO 직렬화할 메시지입니다. \endif \if EN The message to serialize. \endif

반환: \if KO 직렬화된 UTF-8 JSON 바이트입니다. \endif \if EN The serialized UTF-8 JSON bytes. \endif

_options Field

\if KO options 값을 보관합니다. \endif \if EN Stores the options value. \endif

LengthPrefixedMessageFrameCodec

#ctor Method

\if KO 최대 프레임 길이 1MiB로 코덱을 초기화합니다. \endif \if EN Initializes the codec with a 1 MiB maximum frame length. \endif

#ctor Method

\if KO 지정한 최대 프레임 길이로 코덱을 초기화합니다. \endif \if EN Initializes the codec with the specified maximum frame length. \endif

maxFrameLength— \if KO 허용할 최대 페이로드 바이트 수입니다. \endif \if EN The maximum permitted payload size in bytes. \endif
ReadExactAsync Method

\if KO 요청한 바이트 수를 모두 읽거나 스트림 종료를 만날 때까지 반복해서 읽습니다. \endif \if EN Repeatedly reads until the requested byte count is filled or the stream ends. \endif

stream— \if KO 데이터를 읽을 스트림입니다. \endif \if EN The stream to read. \endif
length— \if KO 정확히 읽을 바이트 수입니다. \endif \if EN The exact number of bytes to read. \endif
cancellationToken— \if KO 읽기 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe read cancellation. \endif

반환: \if KO 완성된 버퍼이며, 첫 바이트 전에 스트림이 끝나면 입니다. \endif \if EN The filled buffer, or when the stream ends before the first byte. \endif

ReadFrameAsync Method

\if KO 길이 접두사와 해당 크기의 페이로드를 비동기 읽습니다. \endif \if EN Asynchronously reads a length prefix and its corresponding payload. \endif

stream— \if KO 읽을 스트림입니다. \endif \if EN The source stream. \endif
cancellationToken— \if KO 읽기 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe read cancellation. \endif

반환: \if KO 읽은 페이로드이며, 헤더 전에 스트림이 끝나면 입니다. \endif \if EN The payload, or when the stream ends before a header. \endif

WriteFrameAsync Method

\if KO 4바이트 길이 접두사와 페이로드를 스트림에 비동기 기록합니다. \endif \if EN Asynchronously writes a four-byte length prefix and payload. \endif

stream— \if KO 기록할 스트림입니다. \endif \if EN The destination stream. \endif
payload— \if KO 프레임에 기록할 메시지 데이터입니다. \endif \if EN The message data written in the frame. \endif
cancellationToken— \if KO 쓰기 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe write cancellation. \endif

반환: \if KO 비동기 프레임 쓰기 작업입니다. \endif \if EN A task representing the asynchronous frame write. \endif

_maxFrameLength Field

\if KO max Frame Length 값을 보관합니다. \endif \if EN Stores the max frame length value. \endif

HeaderSize Field

\if KO Header Size 값을 보관합니다. \endif \if EN Stores the header size value. \endif

MessageEnvelopeExtensions

FromStringPayload Method

\if KO UTF-8 문자열 페이로드를 가진 새 를 생성합니다. \endif \if EN Creates a new with a UTF-8 string payload. \endif

route— \if KO 새 메시지의 라우트입니다. \endif \if EN The route of the new message. \endif
name— \if KO 새 메시지의 논리적 이름입니다. \endif \if EN The logical name of the new message. \endif
payload— \if KO UTF-8로 인코딩할 문자열입니다. 이면 빈 문자열로 처리합니다. \endif \if EN The string to encode as UTF-8; is treated as an empty string. \endif

반환: \if KO 지정한 라우트, 이름 및 페이로드를 가진 새 메시지입니다. \endif \if EN A new message with the specified route, name, and payload. \endif

GetPayloadAsString Method

\if KO 메시지의 이진 페이로드를 UTF-8 문자열로 변환합니다. \endif \if EN Converts a message's binary payload to a UTF-8 string. \endif

message— \if KO 페이로드를 읽을 메시지입니다. \endif \if EN The message whose payload is read. \endif

반환: \if KO UTF-8로 디코딩한 페이로드 문자열입니다. \endif \if EN The payload decoded as a UTF-8 string. \endif

MessageHandlerRegistration

#ctor Method

\if KO 지정한 라우트와 처리기로 을 초기화합니다. \endif \if EN Initializes a with the specified route and handler. \endif

route— \if KO 처리기가 수신할 메시지 라우트입니다. \endif \if EN The message route received by the handler. \endif
handler— \if KO 메시지를 처리할 비동기 대리자입니다. \endif \if EN The asynchronous delegate that processes a message. \endif
Handler Property

\if KO 등록된 비동기 메시지 처리기를 가져옵니다. \endif \if EN Gets the registered asynchronous message handler. \endif

Route Property

\if KO 등록된 메시지 라우트를 가져옵니다. \endif \if EN Gets the registered message route. \endif

MessageRouter

Clear Method

\if KO 모든 라우트에서 등록된 메시지 처리기를 제거합니다. \endif \if EN Removes every registered message handler from all routes. \endif

Register Method

\if KO 지정한 라우트에 비동기 메시지 처리기를 등록합니다. \endif \if EN Registers an asynchronous message handler for a route. \endif

route— \if KO 처리기를 연결할 라우트입니다. \endif \if EN The route to associate with the handler. \endif
handler— \if KO 메시지를 처리할 비동기 대리자입니다. \endif \if EN The asynchronous delegate that processes messages. \endif
RouteAsync Method

\if KO 메시지 라우트에 등록된 모든 처리기를 순서대로 비동기 실행합니다. \endif \if EN Asynchronously invokes all handlers registered for the message route in registration order. \endif

message— \if KO 라우팅할 메시지입니다. \endif \if EN The message to route. \endif
cancellationToken— \if KO 처리기 실행 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel handler execution. \endif

반환: \if KO 모든 일치 처리기의 비동기 실행 작업입니다. \endif \if EN A task representing asynchronous execution of all matching handlers. \endif

Unregister Method

\if KO 지정한 라우트에서 특정 메시지 처리기를 제거합니다. \endif \if EN Removes a specific message handler from a route. \endif

route— \if KO 처리기가 등록된 라우트입니다. \endif \if EN The route on which the handler is registered. \endif
handler— \if KO 제거할 처리기입니다. \endif \if EN The handler to remove. \endif

반환: \if KO 처리기를 찾아 제거했으면 입니다. \endif \if EN when the handler was found and removed. \endif

_handlers Field

\if KO handlers 값을 보관합니다. \endif \if EN Stores the handlers value. \endif

PlainTextProtocolAdapter

#ctor Method

\if KO 기본 일반 텍스트 설정으로 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with default plain-text settings. \endif

#ctor Method

\if KO 인코딩과 메시지 메타데이터를 지정하여 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with an encoding and message metadata. \endif

encoding— \if KO 외부 텍스트 송수신에 사용할 인코딩입니다. \endif \if EN The encoding used for external text input and output. \endif
route— \if KO 디코딩한 메시지에 지정할 라우트입니다. \endif \if EN The route assigned to decoded messages. \endif
name— \if KO 디코딩한 메시지에 지정할 이름입니다. \endif \if EN The name assigned to decoded messages. \endif
#ctor Method

\if KO 지정한 일반 텍스트 설정으로 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with the specified plain-text options. \endif

options— \if KO 인코딩과 메시지 메타데이터 설정입니다. \endif \if EN The encoding and message metadata settings. \endif
Decode Method

\if KO 외부 인코딩의 텍스트 바이트를 Dreamine 메시지 봉투로 변환합니다. \endif \if EN Converts externally encoded text bytes into a Dreamine message envelope. \endif

payload— \if KO 수신한 텍스트 바이트입니다. \endif \if EN The received text bytes. \endif

반환: \if KO 구성된 라우트, 이름 및 텍스트 헤더를 가진 메시지입니다. \endif \if EN A message containing the configured route, name, and text headers. \endif

Encode Method

\if KO 메시지의 UTF-8 페이로드를 외부 인코딩의 텍스트 바이트로 변환합니다. \endif \if EN Converts a message's UTF-8 payload into externally encoded text bytes. \endif

message— \if KO 송신할 메시지입니다. \endif \if EN The message to send. \endif

반환: \if KO 외부 시스템으로 송신할 텍스트 바이트입니다. \endif \if EN The text bytes to send to the external system. \endif

NormalizePayloadToUtf8 Property

\if KO 디코딩한 텍스트 페이로드를 내부 UTF-8 형식으로 정규화할지 여부를 가져옵니다. \endif \if EN Gets whether decoded text payloads are normalized to the internal UTF-8 format. \endif

_encoding Field

\if KO encoding 값을 보관합니다. \endif \if EN Stores the encoding value. \endif

_name Field

\if KO name 값을 보관합니다. \endif \if EN Stores the name value. \endif

_route Field

\if KO route 값을 보관합니다. \endif \if EN Stores the route value. \endif

PlainTextProtocolOptions

CreateEncoding Method

\if KO 표시 이름에 해당하는 엄격한 문자열 인코딩을 생성합니다. \endif \if EN Creates a strict text encoding for the specified display name. \endif

encodingName— \if KO 인코딩 표시 이름입니다. 비어 있으면 UTF-8을 사용하며 UTF-8, CP949 및 시스템 등록 인코딩을 지원합니다. \endif \if EN The encoding display name; empty values use UTF-8, while UTF-8, CP949, and system-registered encodings are supported. \endif

반환: \if KO 요청한 표시 이름에 해당하는 인코딩입니다. \endif \if EN The encoding that corresponds to the requested display name. \endif

EnsureCodePageProviderRegistered Method

\if KO 레거시 코드 페이지 인코딩 공급자를 프로세스에 한 번만 등록합니다. \endif \if EN Registers the legacy code-page encoding provider once per process. \endif

Encoding Property

\if KO 외부 일반 텍스트 송수신에 사용할 문자열 인코딩을 가져옵니다. \endif \if EN Gets the text encoding used for external plain-text input and output. \endif

Name Property

\if KO 디코딩할 때 생성되는 메시지의 이름을 가져옵니다. \endif \if EN Gets the name assigned to messages created during decoding. \endif

NormalizePayloadToUtf8 Property

\if KO 디코딩한 문자열 페이로드를 Dreamine 내부 표준 UTF-8로 정규화할지 여부를 가져옵니다. \endif \if EN Gets whether decoded text payloads are normalized to Dreamine's internal UTF-8 format. \endif

Route Property

\if KO 디코딩할 때 생성되는 메시지의 라우트를 가져옵니다. \endif \if EN Gets the route assigned to messages created during decoding. \endif

_isCodePageProviderRegistered Field

\if KO is Code Page Provider Registered 값을 보관합니다. \endif \if EN Stores the is code page provider registered value. \endif

KoreanCodePage949EncodingName Field

\if KO 한국어 Windows ANSI 코드 페이지 949의 표시 이름입니다. \endif \if EN The display name for Korean Windows ANSI code page 949. \endif

Utf8EncodingName Field

\if KO UTF-8 인코딩의 표준 표시 이름입니다. \endif \if EN The standard display name for UTF-8 encoding. \endif

QueuedOutboundMessage

#ctor Method

\if KO 현재 시각에 처음 큐에 들어온 메시지로 를 초기화합니다. \endif \if EN Initializes a as a first-time enqueue at the current time. \endif

message— \if KO 보관할 메시지입니다. \endif \if EN The message to retain. \endif
#ctor Method

\if KO 저장 시각과 재시도 정보를 지정하여 를 초기화합니다. \endif \if EN Initializes a with enqueue and retry information. \endif

message— \if KO 보관할 메시지입니다. \endif \if EN The message to retain. \endif
enqueuedAt— \if KO 메시지가 처음 큐에 저장된 시각입니다. \endif \if EN The time at which the message was first enqueued. \endif
attemptCount— \if KO 지금까지 수행한 전송 시도 횟수입니다. \endif \if EN The number of send attempts made so far. \endif
lastError— \if KO 마지막 전송 실패 메시지입니다. \endif \if EN The error message from the most recent send failure. \endif
IsExpired Method

\if KO 지정한 최대 보관 시간과 현재 시각을 기준으로 메시지의 만료 여부를 확인합니다. \endif \if EN Determines whether the message has expired for a maximum age and current time. \endif

maxAge— \if KO 허용할 최대 보관 시간입니다. 이면 만료되지 않습니다. \endif \if EN The maximum allowed age; disables expiration. \endif
now— \if KO 만료 계산에 사용할 현재 시각입니다. \endif \if EN The current time used for the expiration calculation. \endif

반환: \if KO 최대 보관 시간을 초과했으면 , 아니면 입니다. \endif \if EN when the maximum age is exceeded; otherwise, . \endif

WithFailure Method

\if KO 전송 시도 횟수와 마지막 오류를 갱신한 새 큐 메시지를 생성합니다. \endif \if EN Creates a new queued message with an updated attempt count and last error. \endif

exception— \if KO 마지막 전송 실패를 나타내는 예외입니다. \endif \if EN The exception that represents the most recent send failure. \endif

반환: \if KO 실패 정보가 반영된 새 큐 메시지입니다. \endif \if EN A new queued message containing the failure information. \endif

AttemptCount Property

\if KO 전송 시도 횟수를 가져옵니다. \endif \if EN Gets the number of send attempts. \endif

EnqueuedAt Property

\if KO 메시지가 처음 큐에 저장된 시각을 가져옵니다. \endif \if EN Gets the time at which the message was first enqueued. \endif

LastError Property

\if KO 마지막 전송 실패 메시지를 가져옵니다. \endif \if EN Gets the most recent send error message. \endif

Message Property

\if KO 보관된 메시지를 가져옵니다. \endif \if EN Gets the retained message. \endif

RawAvailableMessageFrameCodec

#ctor Method

\if KO 기본 8KiB 수신 버퍼로 코덱을 초기화합니다. \endif \if EN Initializes the codec with the default 8 KiB receive buffer. \endif

#ctor Method

\if KO 지정한 수신 버퍼 크기로 코덱을 초기화합니다. \endif \if EN Initializes the codec with the specified receive buffer size. \endif

bufferSize— \if KO 한 번의 읽기에 사용할 최대 버퍼 바이트 수입니다. \endif \if EN The maximum buffer size in bytes used for one read. \endif
ReadFrameAsync Method

\if KO 스트림에서 현재 수신 가능한 데이터를 한 번 읽어 하나의 프레임으로 반환합니다. \endif \if EN Performs one read and returns the currently available data as a single frame. \endif

stream— \if KO 읽을 스트림입니다. \endif \if EN The source stream. \endif
cancellationToken— \if KO 읽기 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe read cancellation. \endif

반환: \if KO 읽은 바이트이며, 스트림이 종료되면 입니다. \endif \if EN The bytes read, or when the stream has ended. \endif

WriteFrameAsync Method

\if KO 길이 또는 구분자를 추가하지 않고 페이로드를 그대로 비동기 기록합니다. \endif \if EN Asynchronously writes the payload without adding a length or delimiter. \endif

stream— \if KO 기록할 스트림입니다. \endif \if EN The destination stream. \endif
payload— \if KO 그대로 기록할 메시지 데이터입니다. \endif \if EN The message data written unchanged. \endif
cancellationToken— \if KO 쓰기 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe write cancellation. \endif

반환: \if KO 비동기 쓰기 작업입니다. \endif \if EN A task representing the asynchronous write. \endif

_bufferSize Field

\if KO buffer Size 값을 보관합니다. \endif \if EN Stores the buffer size value. \endif

RawJsonProtocolAdapter

#ctor Method

\if KO 기본 원시 JSON 설정으로 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with default raw JSON settings. \endif

#ctor Method

\if KO 기본 라우트와 이름을 지정하여 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with a default route and name. \endif

defaultRoute— \if KO JSON에서 라우트를 찾지 못할 때 사용할 값입니다. \endif \if EN The value used when no route is found in JSON. \endif
defaultName— \if KO JSON에서 이름을 찾지 못할 때 사용할 값입니다. \endif \if EN The value used when no name is found in JSON. \endif
#ctor Method

\if KO 외부 인코딩과 기본 메시지 메타데이터로 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with an external encoding and default message metadata. \endif

encoding— \if KO 외부 JSON 송수신에 사용할 인코딩입니다. \endif \if EN The encoding used for external JSON input and output. \endif
defaultRoute— \if KO 라우트 추출 실패 시 사용할 값입니다. \endif \if EN The route used when extraction fails. \endif
defaultName— \if KO 이름 추출 실패 시 사용할 값입니다. \endif \if EN The name used when extraction fails. \endif
#ctor Method

\if KO 지정한 원시 JSON 설정으로 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with the specified raw JSON options. \endif

options— \if KO 인코딩과 기본 메시지 메타데이터 설정입니다. \endif \if EN The encoding and default message metadata settings. \endif
Decode Method

\if KO 원시 JSON을 분석하여 라우트와 이름을 가진 메시지 봉투로 변환합니다. \endif \if EN Parses raw JSON into a message envelope with an extracted route and name. \endif

payload— \if KO 수신한 외부 JSON 바이트입니다. \endif \if EN The received external JSON bytes. \endif

반환: \if KO JSON 페이로드와 추출한 메타데이터를 가진 메시지입니다. \endif \if EN A message containing the JSON payload and extracted metadata. \endif

Encode Method

\if KO 메시지 페이로드 또는 메타데이터를 외부 인코딩의 JSON 바이트로 변환합니다. \endif \if EN Converts a message payload or its metadata into externally encoded JSON bytes. \endif

message— \if KO 송신할 메시지입니다. \endif \if EN The message to send. \endif

반환: \if KO 외부 시스템으로 송신할 JSON 바이트입니다. \endif \if EN The JSON bytes to send to the external system. \endif

TryGetString Method

\if KO JSON 루트에서 지정한 속성을 찾아 문자열 표현으로 반환합니다. \endif \if EN Finds a property on the JSON root and returns its string representation. \endif

root— \if KO 검색할 JSON 루트 요소입니다. \endif \if EN The JSON root element to search. \endif
propertyName— \if KO 찾을 속성 이름입니다. \endif \if EN The property name to find. \endif

반환: \if KO 속성의 문자열 값이며, 속성이 없으면 입니다. \endif \if EN The property's string value, or when absent. \endif

NormalizePayloadToUtf8 Property

\if KO 디코딩한 JSON 페이로드를 내부 UTF-8 형식으로 정규화할지 여부를 가져옵니다. \endif \if EN Gets whether decoded JSON payloads are normalized to the internal UTF-8 format. \endif

_defaultName Field

\if KO default Name 값을 보관합니다. \endif \if EN Stores the default name value. \endif

_defaultRoute Field

\if KO default Route 값을 보관합니다. \endif \if EN Stores the default route value. \endif

_encoding Field

\if KO encoding 값을 보관합니다. \endif \if EN Stores the encoding value. \endif

RawJsonProtocolOptions

DefaultName Property

\if KO JSON에서 이름을 추출하지 못했을 때 사용할 기본 메시지 이름을 가져옵니다. \endif \if EN Gets the default message name used when no name can be extracted from JSON. \endif

DefaultRoute Property

\if KO JSON에서 라우트를 추출하지 못했을 때 사용할 기본 라우트를 가져옵니다. \endif \if EN Gets the default route used when no route can be extracted from JSON. \endif

Encoding Property

\if KO 외부 원시 JSON 송수신에 사용할 문자열 인코딩을 가져옵니다. \endif \if EN Gets the text encoding used for external raw JSON input and output. \endif

NormalizePayloadToUtf8 Property

\if KO 디코딩한 JSON 페이로드를 Dreamine 내부 표준 UTF-8로 정규화할지 여부를 가져옵니다. \endif \if EN Gets whether decoded JSON payloads are normalized to Dreamine's internal UTF-8 format. \endif

ReconnectDelayCalculator

#ctor Method

\if KO 지정한 정책으로 를 초기화합니다. \endif \if EN Initializes a with the specified policy. \endif

policy— \if KO 대기 시간 계산에 사용할 정책입니다. 이면 기본 정책을 사용합니다. \endif \if EN The policy used to calculate delays; uses the default policy. \endif
Calculate Method

\if KO 지정한 재시도 횟수에 적용할 대기 시간을 계산합니다. \endif \if EN Calculates the delay to apply for the specified retry attempt. \endif

attemptCount— \if KO 1부터 시작하는 재시도 횟수입니다. 1 이하의 값은 최초 대기 시간으로 처리합니다. \endif \if EN The one-based retry attempt; values of one or less use the initial delay. \endif

반환: \if KO 1밀리초 이상이며 정책의 최대 대기 시간을 넘지 않는 계산 결과입니다. \endif \if EN The calculated delay, at least one millisecond and no greater than the policy maximum. \endif

NormalizeDelay Method

\if KO 대기 시간을 최소 1밀리초의 양수 값으로 정규화합니다. \endif \if EN Normalizes a delay to a positive value of at least one millisecond. \endif

delay— \if KO 정규화할 대기 시간입니다. \endif \if EN The delay to normalize. \endif

반환: \if KO 정규화된 양수 대기 시간입니다. \endif \if EN The normalized positive delay. \endif

_policy Field

\if KO policy 값을 보관합니다. \endif \if EN Stores the policy value. \endif

ResilientMessageTransport

#ctor Method

\if KO 내부 전송 계층과 선택적 복원·큐 설정으로 전송 계층을 초기화합니다. \endif \if EN Initializes the transport with an inner transport and optional resilience and queue settings. \endif

innerTransport— \if KO 실제 연결과 송수신을 담당할 전송 계층입니다. \endif \if EN The transport responsible for the physical connection and message transfer. \endif
reconnectPolicy— \if KO 재연결 간격과 횟수를 제어할 정책입니다. \endif \if EN The policy controlling reconnection intervals and attempts. \endif
queueOptions— \if KO 연결 끊김 송신 처리와 큐 제한 설정입니다. \endif \if EN The disconnected-send behavior and queue limits. \endif
outboundQueue— \if KO 사용자 지정 송신 큐이며, 이면 메모리 큐를 생성합니다. \endif \if EN A custom outbound queue; creates an in-memory queue. \endif
ConnectAsync Method

\if KO 내부 연결과 필요 시 백그라운드 재연결 루프를 시작합니다. \endif \if EN Starts the inner connection and, when enabled, the background reconnection loop. \endif

cancellationToken— \if KO 최초 연결과 큐 전송 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe cancellation of the initial connection and queue flush. \endif

반환: \if KO 비동기 연결 및 초기 큐 처리 작업입니다. \endif \if EN A task representing connection and initial queue processing. \endif

DelaySafelyAsync Method

\if KO 최소 양수 시간 동안 대기하고 정상적인 취소 예외를 내부에서 처리합니다. \endif \if EN Delays for a positive duration and handles normal cancellation internally. \endif

delay— \if KO 대기할 시간입니다. \endif \if EN The duration to wait. \endif
cancellationToken— \if KO 대기 취소 토큰입니다. \endif \if EN A token used to cancel the delay. \endif

반환: \if KO 안전한 비동기 대기 작업입니다. \endif \if EN A task representing the safe asynchronous delay. \endif

DisconnectAsync Method

\if KO 자동 재연결을 중지하고 내부 연결을 종료합니다. \endif \if EN Stops automatic reconnection and disconnects the inner transport. \endif

cancellationToken— \if KO 연결 해제 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe disconnection cancellation. \endif

반환: \if KO 비동기 연결 해제 작업입니다. \endif \if EN A task representing asynchronous disconnection. \endif

DisposeAsync Method

\if KO 재연결 루프를 중지하고 내부 전송 계층과 동기화 리소스를 비동기 해제합니다. \endif \if EN Stops the reconnection loop and asynchronously releases the inner transport and synchronization resources. \endif \if KO 비동기 리소스 해제 작업입니다. \endif \if EN A value task representing asynchronous resource disposal. \endif

EnsureResilienceLoopStarted Method

\if KO 자동 재연결이 활성화된 경우 복원 루프가 하나만 실행되도록 보장합니다. \endif \if EN Ensures that exactly one resilience loop runs when automatic reconnection is enabled. \endif

FlushQueueAsync Method

\if KO 연결된 동안 만료되지 않은 송신 대기 메시지를 순서대로 전송합니다. \endif \if EN Sends non-expired queued messages in order while connected. \endif

cancellationToken— \if KO 큐 전송 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe queue-flush cancellation. \endif

반환: \if KO 비동기 큐 전송 작업입니다. \endif \if EN A task representing the asynchronous queue flush. \endif

HandleDisconnectedSendAsync Method

\if KO 연결 끊김 송신 정책에 따라 실패, 큐 저장 또는 연결 대기 후 송신을 수행합니다. \endif \if EN Applies the disconnected-send policy by failing, queueing, or waiting to send. \endif

message— \if KO 처리할 송신 메시지입니다. \endif \if EN The outbound message to process. \endif
cancellationToken— \if KO 비동기 처리 취소 토큰입니다. \endif \if EN A token used to cancel asynchronous processing. \endif

반환: \if KO 정책 처리 작업입니다. \endif \if EN A task representing policy processing. \endif

IsOperationalState Method

\if KO 지정한 상태가 메시지 송신 가능한 연결 또는 수신 대기 상태인지 확인합니다. \endif \if EN Determines whether a state is connected or listening and therefore operational. \endif

state— \if KO 검사할 연결 상태입니다. \endif \if EN The connection state to inspect. \endif

반환: \if KO 동작 가능한 상태이면 입니다. \endif \if EN when the state is operational. \endif

NotifyQueueCountChanged Method

\if KO 현재 송신 큐 개수로 큐 변경 이벤트를 발생시킵니다. \endif \if EN Raises the queue-count event with the current outbound queue size. \endif

NotifyStateChangedIfNeeded Method

\if KO 마지막 알림 이후 유효 연결 상태가 바뀐 경우에만 상태 변경 이벤트를 발생시킵니다. \endif \if EN Raises the state-change event only when the effective state changed since the last notification. \endif

OnInnerMessageReceived Method

\if KO 내부 수신 이벤트를 현재 전송 계층의 수신 이벤트로 다시 발생시킵니다. \endif \if EN Re-raises an inner receive event through this transport. \endif

sender— \if KO 내부 이벤트 발생 객체이며 사용하지 않습니다. \endif \if EN The inner event sender; it is not used. \endif
message— \if KO 수신한 메시지입니다. \endif \if EN The received message. \endif
RunResilienceLoopAsync Method

\if KO 연결 감시, 재연결 백오프 및 큐 전송을 수행하는 백그라운드 루프를 실행합니다. \endif \if EN Runs the background loop for connection monitoring, reconnection backoff, and queue flushing. \endif

cancellationToken— \if KO 루프 종료를 요청하는 토큰입니다. \endif \if EN A token used to request loop termination. \endif

반환: \if KO 복원 루프 작업입니다. \endif \if EN A task representing the resilience loop. \endif

SendAsync Method

\if KO 연결 상태와 끊김 송신 정책에 따라 즉시 전송하거나 큐에 저장합니다. \endif \if EN Sends immediately or queues the message according to connection state and policy. \endif

message— \if KO 전송할 메시지입니다. \endif \if EN The message to send. \endif
cancellationToken— \if KO 송신 또는 큐 저장 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe cancellation of sending or queueing. \endif

반환: \if KO 비동기 송신 또는 큐 저장 작업입니다. \endif \if EN A task representing asynchronous sending or queueing. \endif

SetManualDisconnectRequested Method

\if KO 수동 연결 해제 요청 플래그를 스레드 안전하게 설정합니다. \endif \if EN Sets the manual-disconnection flag in a thread-safe manner. \endif

value— \if KO 설정할 플래그 값입니다. \endif \if EN The flag value to set. \endif
SetResilienceLoopRequested Method

\if KO 복원 루프 실행 요청 플래그를 스레드 안전하게 설정합니다. \endif \if EN Sets the resilience-loop request flag in a thread-safe manner. \endif

value— \if KO 설정할 플래그 값입니다. \endif \if EN The flag value to set. \endif
ThrowIfDisposed Method

\if KO 전송 계층이 이미 해제되었으면 예외를 발생시킵니다. \endif \if EN Throws when the transport has already been disposed. \endif

WaitUntilConnectedAsync Method

\if KO 복원 루프를 시작하고 내부 전송 계층이 연결될 때까지 비동기 대기합니다. \endif \if EN Starts the resilience loop and asynchronously waits for the inner transport to connect. \endif

cancellationToken— \if KO 대기 취소 토큰입니다. \endif \if EN A token used to cancel waiting. \endif

반환: \if KO 연결 대기 작업입니다. \endif \if EN A task representing the connection wait. \endif

IsManualDisconnectRequested Property

\if KO 호출자가 수동 연결 해제를 요청했는지 스레드 안전하게 확인합니다. \endif \if EN Gets, in a thread-safe manner, whether the caller requested manual disconnection. \endif

IsResilienceLoopRequested Property

\if KO 연결 복원 루프 실행이 요청되었는지 스레드 안전하게 확인합니다. \endif \if EN Gets, in a thread-safe manner, whether execution of the connection-resilience loop was requested. \endif

Kind Property

\if KO 내부 전송 계층의 전송 방식을 가져옵니다. \endif \if EN Gets the transport kind of the inner transport. \endif

QueuedMessageCount Property

\if KO 현재 송신 대기 큐에 저장된 메시지 수를 가져옵니다. \endif \if EN Gets the number of messages currently waiting in the outbound queue. \endif

State Property

\if KO 내부 상태와 재연결 루프를 반영한 현재 유효 연결 상태를 가져옵니다. \endif \if EN Gets the effective connection state derived from the inner state and reconnection loop. \endif

_delayCalculator Field

\if KO delay Calculator 값을 보관합니다. \endif \if EN Stores the delay calculator value. \endif

_disposed Field

\if KO disposed 값을 보관합니다. \endif \if EN Stores the disposed value. \endif

_disposeGuard Field

\if KO dispose Guard 값을 보관합니다. \endif \if EN Stores the dispose guard value. \endif

_flushLock Field

\if KO flush Lock 값을 보관합니다. \endif \if EN Stores the flush lock value. \endif

_innerTransport Field

\if KO inner Transport 값을 보관합니다. \endif \if EN Stores the inner transport value. \endif

_lastNotifiedState Field

\if KO last Notified State 값을 보관합니다. \endif \if EN Stores the last notified state value. \endif

_lifetimeCts Field

\if KO lifetime Cts 값을 보관합니다. \endif \if EN Stores the lifetime cts value. \endif

_loopSync Field

\if KO loop Sync 값을 보관합니다. \endif \if EN Stores the loop sync value. \endif

_manualDisconnectRequested Field

\if KO manual Disconnect Requested 값을 보관합니다. \endif \if EN Stores the manual disconnect requested value. \endif

_notifySync Field

\if KO notify Sync 값을 보관합니다. \endif \if EN Stores the notify sync value. \endif

_outboundQueue Field

\if KO outbound Queue 값을 보관합니다. \endif \if EN Stores the outbound queue value. \endif

_queueOptions Field

\if KO queue Options 값을 보관합니다. \endif \if EN Stores the queue options value. \endif

_reconnectPolicy Field

\if KO reconnect Policy 값을 보관합니다. \endif \if EN Stores the reconnect policy value. \endif

_resilienceLoopRequested Field

\if KO resilience Loop Requested 값을 보관합니다. \endif \if EN Stores the resilience loop requested value. \endif

_resilienceLoopTask Field

\if KO resilience Loop Task 값을 보관합니다. \endif \if EN Stores the resilience loop task value. \endif

MessageReceived Event

\if KO 내부 전송 계층이 메시지를 수신했을 때 발생합니다. \endif \if EN Occurs when the inner transport receives a message. \endif

QueueCountChanged Event

\if KO 송신 대기 큐의 메시지 수가 변경될 때 발생합니다. \endif \if EN Occurs when the number of queued outbound messages changes. \endif

StateChanged Event

\if KO 복원 동작을 반영한 유효 연결 상태가 변경될 때 발생합니다. \endif \if EN Occurs when the effective connection state, including resilience activity, changes. \endif

TransportMessageBusAdapter

#ctor Method

\if KO 지정한 메시지 전송 계층으로 어댑터를 초기화합니다. \endif \if EN Initializes the adapter with the specified message transport. \endif

transport— \if KO 연결과 송수신을 담당할 내부 전송 계층입니다. \endif \if EN The inner transport responsible for connection and message transfer. \endif
ConnectAsync Method

\if KO 내부 전송 계층에 비동기적으로 연결합니다. \endif \if EN Asynchronously connects the inner transport. \endif

cancellationToken— \if KO 연결 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the connection. \endif

반환: \if KO 내부 전송 계층의 비동기 연결 작업입니다. \endif \if EN The asynchronous connection task returned by the inner transport. \endif

DisconnectAsync Method

\if KO 내부 전송 계층의 연결을 비동기적으로 해제합니다. \endif \if EN Asynchronously disconnects the inner transport. \endif

cancellationToken— \if KO 연결 해제 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel disconnection. \endif

반환: \if KO 내부 전송 계층의 비동기 연결 해제 작업입니다. \endif \if EN The asynchronous disconnection task returned by the inner transport. \endif

Dispose Method

\if KO 이벤트 구독을 해제하고 내부 전송 계층의 비동기 해제를 대기하지 않고 시작합니다. \endif \if EN Detaches event subscriptions and starts disposal of the inner transport without awaiting it. \endif

DisposeAsync Method

\if KO 이벤트 구독과 내부 전송 계층 리소스를 비동기적으로 해제합니다. \endif \if EN Asynchronously releases event subscriptions and inner-transport resources. \endif \if KO 비동기 해제 작업입니다. \endif \if EN A value task representing asynchronous disposal. \endif

OnMessageReceived Method

\if KO 내부 전송 계층에서 수신한 메시지를 해당 라우트에 등록된 처리기들에게 비동기적으로 전달합니다. \endif \if EN Asynchronously dispatches a message received from the inner transport to handlers registered for its route. \endif

sender— \if KO 메시지 수신 이벤트를 발생시킨 객체입니다. 이 구현에서는 사용하지 않습니다. \endif \if EN The object that raised the receive event; this implementation does not use it. \endif
message— \if KO 등록된 처리기들에게 전달할 수신 메시지입니다. \endif \if EN The received message to dispatch to registered handlers. \endif
PublishAsync Method

\if KO 내부 전송 계층을 통해 메시지를 비동기적으로 발행합니다. \endif \if EN Asynchronously publishes a message through the inner transport. \endif

message— \if KO 발행할 메시지입니다. \endif \if EN The message to publish. \endif
cancellationToken— \if KO 발행 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel publishing. \endif

반환: \if KO 내부 전송 계층의 비동기 송신 작업입니다. \endif \if EN The asynchronous send task returned by the inner transport. \endif

SubscribeAsync Method

\if KO 지정한 라우트에 비동기 메시지 처리기를 등록합니다. \endif \if EN Registers an asynchronous message handler for the specified route. \endif

route— \if KO 구독할 라우트입니다. \endif \if EN The route to subscribe to. \endif
handler— \if KO 수신 메시지를 처리할 비동기 대리자입니다. \endif \if EN The asynchronous delegate that processes received messages. \endif
cancellationToken— \if KO 구독 취소 요청을 감시하는 토큰입니다. \endif \if EN A token used to observe requests to cancel the subscription. \endif

반환: \if KO 완료된 비동기 구독 작업입니다. \endif \if EN A completed task representing the subscription operation. \endif

Kind Property

\if KO 내부 전송 계층의 전송 방식을 가져옵니다. \endif \if EN Gets the transport kind of the inner transport. \endif

OnHandlerError Property

\if KO 메시지 처리기에서 예상하지 못한 예외가 발생할 때 호출할 콜백을 가져오거나 설정합니다. 기본값은 입니다. \endif \if EN Gets or sets the callback invoked when a message handler throws an unexpected exception; the default is . \endif

State Property

\if KO 내부 전송 계층의 현재 연결 상태를 가져옵니다. \endif \if EN Gets the current connection state of the inner transport. \endif

_handlers Field

\if KO handlers 값을 보관합니다. \endif \if EN Stores the handlers value. \endif

_transport Field

\if KO transport 값을 보관합니다. \endif \if EN Stores the transport value. \endif