コード例 #1
0
        WebSocketClientOnMessageReceived(object sender, GdaxWebSocketMessageEventArgs eventArgs)
        {
            dynamic m = eventArgs.Message;

            string type = m.type;

            switch (type)
            {
            case "received":
                ProcessReceivedMessage(eventArgs.Message);
                break;

            case "open":
                ProcessOpenMessage(eventArgs.Message);
                break;

            case "done":
                ProcessDoneMessage(eventArgs.Message);
                break;

            case "match":
                ProcessMatchMessage(eventArgs.Message);
                break;

            case "change":
                ProcessChangeMessage(eventArgs.Message);
                break;

            default:
                return;
            }
        }
コード例 #2
0
 void SocketMessageReceived(object sender, GdaxWebSocketMessageEventArgs e)
 {
     if (e.Message["product_id"].ToString() == _instrument.Symbol)
     {
         if (_bookBuildingInProgress)
         {
             _pending.Enqueue(e.Message);
         }
         else
         {
             ProcessLiveOrderMessage(e.Message);
         }
     }
 }