D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
ikatson
Full window
Github gist
uwsgi Websocket error: ASYNC call without async mode !!!, IOError: unable to fd to the event queue
<!doctype html> <meta charset=utf-8> <title>UWSGI WS test</title> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script> <script> angular.module('app', []).controller('Ctrl', function ($scope) { this.logMessages = []; var self = this; var log = function (msg) { self.logMessages.push({date: new Date(), msg: msg}); $scope.$digest(); } var ws = new WebSocket('ws://localhost:5000/ws/'); ws.onopen = function () { log('WS open'); ws.send('message to server'); } ws.onmessage = function (msg) { log('WS message received: ' + msg); }; ws.onclose = function () { log('WS closed'); }; ws.onerror = function (err) { log('WS error: ' + err); } }); </script> <body ng-app="app" ng-controller="Ctrl as ctrl" class="container"> <h2>uWSGI websocket test</h2> <div ng-repeat="msg in ctrl.logMessages.slice().reverse()"><pre>[{{msg.date|date:'mediumTime'}}]: {{msg.msg}}</pre><div> </body>
https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js