{"action":"created","issue":{"url":"https://api.github.com/repos/kesla/runtime-node-net/issues/11","labels_url":"https://api.github.com/repos/kesla/runtime-node-net/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/kesla/runtime-node-net/issues/11/comments","events_url":"https://api.github.com/repos/kesla/runtime-node-net/issues/11/events","html_url":"https://github.com/kesla/runtime-node-net/issues/11","id":90828506,"number":11,"title":"client.write prevents other code from executing","user":{"login":"ArielAbreu","id":11756574,"avatar_url":"https://avatars.githubusercontent.com/u/11756574?v=3","gravatar_id":"","url":"https://api.github.com/users/ArielAbreu","html_url":"https://github.com/ArielAbreu","followers_url":"https://api.github.com/users/ArielAbreu/followers","following_url":"https://api.github.com/users/ArielAbreu/following{/other_user}","gists_url":"https://api.github.com/users/ArielAbreu/gists{/gist_id}","starred_url":"https://api.github.com/users/ArielAbreu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArielAbreu/subscriptions","organizations_url":"https://api.github.com/users/ArielAbreu/orgs","repos_url":"https://api.github.com/users/ArielAbreu/repos","events_url":"https://api.github.com/users/ArielAbreu/events{/privacy}","received_events_url":"https://api.github.com/users/ArielAbreu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-25T02:05:28Z","updated_at":"2015-07-04T19:21:39Z","closed_at":null,"body":"When using `client.write` in the following example, the rest of the code in the callback is not executed:\r\n```js\r\nconst net = require('net');\r\n  var server = net.createServer(function(socket) {\r\n    var chunks = '';\r\n    socket.on('data', function(chunk) {\r\n      chunks += chunk;\r\n      runtime.tty.print(chunks);\r\n    });\r\n    socket.on('end', function() {\r\n      // this never gets printed\r\n      runtime.tty.print('ending');\r\n      server.close();\r\n    });\r\n  });\r\n  // Port 23 is the accepted standard for telnet\r\n  server.listen(23, function() {\r\n    var client = net.createConnection({ port: 23 }, function() {\r\n      // outputs \"stuff\"\r\n      client.write('stuff\\r\\n');\r\n      // this isn't run\r\n      client.write('hey\\r\\n');\r\n      // neither is this\r\n      client.end();\r\n    });\r\n  });\r\n```\r\nThe code is supposed to print:\r\n```\r\nstuff\r\nhey\r\nending\r\n```\r\nBut I get this:\r\n```\r\nstuff\r\n```\r\nDoes `client.write` block? Is it synchronous? If not, any idea what it could be?"},"comment":{"url":"https://api.github.com/repos/kesla/runtime-node-net/issues/comments/118543962","html_url":"https://github.com/kesla/runtime-node-net/issues/11#issuecomment-118543962","issue_url":"https://api.github.com/repos/kesla/runtime-node-net/issues/11","id":118543962,"user":{"login":"kesla","id":74128,"avatar_url":"https://avatars.githubusercontent.com/u/74128?v=3","gravatar_id":"","url":"https://api.github.com/users/kesla","html_url":"https://github.com/kesla","followers_url":"https://api.github.com/users/kesla/followers","following_url":"https://api.github.com/users/kesla/following{/other_user}","gists_url":"https://api.github.com/users/kesla/gists{/gist_id}","starred_url":"https://api.github.com/users/kesla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kesla/subscriptions","organizations_url":"https://api.github.com/users/kesla/orgs","repos_url":"https://api.github.com/users/kesla/repos","events_url":"https://api.github.com/users/kesla/events{/privacy}","received_events_url":"https://api.github.com/users/kesla/received_events","type":"User","site_admin":false},"created_at":"2015-07-04T19:21:39Z","updated_at":"2015-07-04T19:21:39Z","body":"@ArielAbreu hey, sorry for slow response. Taking a look at this now!"}}