Exemple #1
0
        private async Task Send(WebSocket to, JObject o, CancellationToken token)
        {
            string sender = browser == to ? "Send-browser" : "Send-ide";

            //if (method != "Debugger.scriptParsed" && method != "Runtime.consoleAPICalled")
            Log("protocol", $"{sender}: " + JsonConvert.SerializeObject(o));
            byte[] bytes = Encoding.UTF8.GetBytes(o.ToString());

            DevToolsQueue queue = GetQueueForSocket(to);

            Task task = queue.Send(bytes, token);

            if (task != null)
            {
                await _channelWriter.WriteAsync(task, token);
            }
        }
Exemple #2
0
        private void Send(WebSocket to, JObject o, CancellationToken token)
        {
            string sender = browser == to ? "Send-browser" : "Send-ide";

            string method = o["method"]?.ToString();

            //if (method != "Debugger.scriptParsed" && method != "Runtime.consoleAPICalled")
            Log("protocol", $"{sender}: " + JsonConvert.SerializeObject(o));
            byte[] bytes = Encoding.UTF8.GetBytes(o.ToString());

            DevToolsQueue queue = GetQueueForSocket(to);

            Task task = queue.Send(bytes, token);

            if (task != null)
            {
                pending_ops.Add(task);
            }
        }