# AbortMsg

### int AbortMsg(int lMsgId)

전달된 \*\*메시지 ID(lMsgId)\*\*에 해당하는 트랜잭션을 중단(Abort) 처리합니다. 수신된 메시지에 대해 정상적인 응답(Reply)을 보낼 수 없는 상황에서 해당 세션을 강제로 종료할 때 사용합니다.

Parameters

<table data-header-hidden><thead><tr><th width="165" valign="top"></th><th width="90" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Name</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">lMsgId</td><td valign="top">int</td><td valign="top">수신한 메시지에 할당된 고유 ID</td></tr></tbody></table>

```csharp
void OnMsgReceived(IntPtr lpParam, int lMsgId)
{
    // 장비 상태가 비정상적이거나 파싱 오류 발생 시
    bool isErrorDetected = CheckSystemStatus();

    if (isErrorDetected)
    {
        // 해당 메시지를 Abort 처리하여 트랜잭션 종료
        int result = m_gem.AbortMsg(lMsgId);

        if (result == 0)
        {
            Console.WriteLine($"Message [ID: {lMsgId}] has been successfully aborted.");
        }
        else
        {
            Console.WriteLine($"Failed to abort message. Error Code: {result}");
        }
    }
}

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nviasoft.gitbook.io/nviasoft-docs/api-reference/undefined-5/abortmsg.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
