{"action":"opened","issue":{"url":"https://api.github.com/repos/kataras/go-websocket/issues/10","repository_url":"https://api.github.com/repos/kataras/go-websocket","labels_url":"https://api.github.com/repos/kataras/go-websocket/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/kataras/go-websocket/issues/10/comments","events_url":"https://api.github.com/repos/kataras/go-websocket/issues/10/events","html_url":"https://github.com/kataras/go-websocket/issues/10","id":182801931,"number":10,"title":"c.Emit has strange behaviour on fast, low latency connections, like localhost or in LAN","user":{"login":"Ekranos","id":1352343,"avatar_url":"https://avatars.githubusercontent.com/u/1352343?v=3","gravatar_id":"","url":"https://api.github.com/users/Ekranos","html_url":"https://github.com/Ekranos","followers_url":"https://api.github.com/users/Ekranos/followers","following_url":"https://api.github.com/users/Ekranos/following{/other_user}","gists_url":"https://api.github.com/users/Ekranos/gists{/gist_id}","starred_url":"https://api.github.com/users/Ekranos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ekranos/subscriptions","organizations_url":"https://api.github.com/users/Ekranos/orgs","repos_url":"https://api.github.com/users/Ekranos/repos","events_url":"https://api.github.com/users/Ekranos/events{/privacy}","received_events_url":"https://api.github.com/users/Ekranos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-13T14:15:46Z","updated_at":"2016-10-13T14:15:46Z","closed_at":null,"body":"When you have a fast, low latency connection, like you have on localhost, you get a lot of weird output.\r\n\r\nThere is also the interesting thing that the channels get mixed up. In the output below, the message for channel `status` with the text `Idle` shouldn't be there.\r\n\r\nOutput can be like:\r\n```\r\nResponse body size: 2042 bytesgo-websocket-message:log;0;Time to download response body: 1.009msgo-websocket-message:log;0;Total roundtrip time: 176.343msgo-websocket-message:status;0;Idle\r\n```\r\n\r\nServer code:\r\n\r\n```\r\nc.Emit(\"log\", fmt.Sprintf(\"Response body size: %d bytes\", num))\r\nc.Emit(\"log\", fmt.Sprintf(\"Time to download response body: %s\", time.Now().Sub(firstByteTime)))\r\nc.Emit(\"log\", fmt.Sprintf(\"Total roundtrip time: %s\", time.Now().Sub(now)))\r\nc.Emit(\"status\", \"Idle\")\r\n```\r\n\r\nClient code:\r\n```\r\n(function ($) {\r\n    var ws = new Ws(\"ws://localhost:8080/http/tracer/ws\");\r\n    var log = $(\"#log\");\r\n    var status = $(\"#status\");\r\n\r\n    ws.On(\"status\", function (message) {\r\n        status.text(message);\r\n    });\r\n\r\n    ws.On(\"log\", function (message) {\r\n        log.html(log.html() + \"<br/>\" + message);\r\n    });\r\n\r\n    $(\"#form\").submit(function (e) {\r\n        e.preventDefault();\r\n\r\n        log.empty();\r\n        ws.Emit(\"trace\", $(\"#address\").val());\r\n\r\n        return false;\r\n    })\r\n})(jQuery);\r\n```"}}
{"actor":{"display_login":"Ekranos"}}