[#CMessageHeader-2constructor-0e4]
= xref:CMessageHeader.adoc[CMessageHeader]::CMessageHeader
:relfileprefix: ../
:mrdocs:

Construct a P2P message header from message&hyphen;start characters, a message type and the size of the message&period;

== Synopsis

Declared in `&lt;protocol&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
CMessageHeader(
    xref:MessageStartChars.adoc[MessageStartChars] const& pchMessageStartIn,
    char const* msg&lowbar;type,
    unsigned int nMessageSizeIn);
----

== Description

[NOTE]
====
Passing in a `msg&lowbar;type` longer than MESSAGE&lowbar;TYPE&lowbar;SIZE will result in a run&hyphen;time assertion error&period;

====

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pchMessageStartIn*
| Network magic bytes marking the start of the message&period;
| *msg&lowbar;type*
| Null&hyphen;terminated message type string&period;
| *nMessageSizeIn*
| Size of the message payload in bytes&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
