Skip to content

Instantly share code, notes, and snippets.

@shlomoa
Created October 15, 2015 06:40
Show Gist options
  • Save shlomoa/c3c875d32cf735289b91 to your computer and use it in GitHub Desktop.
Save shlomoa/c3c875d32cf735289b91 to your computer and use it in GitHub Desktop.
private unsafe byte[] CreateGatewayRequest()
{
var gr = new GatewayRequest();
var msgHead = new MessageHeaderInComp();
msgHead.BodyLen = (uint)sizeof(GatewayRequest);
msgHead.TemplateID = (ushort) ETIMessageType.GatewayRequest;
gr.MessageHeaderIn = msgHead;
var reqHead = new RequestHeaderComp();
reqHead.MsgSeqNum = 1;
gr.RequestHeader = reqHead;
gr.Password = _eurexExecutionFeed.Password;
gr.DefaultCstmApplVerID = "2.5";
gr.PartyIDSessionID = (uint) _eurexExecutionFeed.SessionId;
byte[] bytes = new byte[sizeof(GatewayRequest)];
fixed (byte* p = bytes)
{
Mem.Cpy((byte*)&gr, p, sizeof(GatewayRequest));
}
return bytes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment