{"action":"created","issue":{"url":"https://api.github.com/repos/node-serialport/node-serialport/issues/1403","repository_url":"https://api.github.com/repos/node-serialport/node-serialport","labels_url":"https://api.github.com/repos/node-serialport/node-serialport/issues/1403/labels{/name}","comments_url":"https://api.github.com/repos/node-serialport/node-serialport/issues/1403/comments","events_url":"https://api.github.com/repos/node-serialport/node-serialport/issues/1403/events","html_url":"https://github.com/node-serialport/node-serialport/issues/1403","id":276038377,"number":1403,"title":"port.write() sometimes hangs on Windows","user":{"login":"gniezen","id":418233,"avatar_url":"https://avatars0.githubusercontent.com/u/418233?v=4","gravatar_id":"","url":"https://api.github.com/users/gniezen","html_url":"https://github.com/gniezen","followers_url":"https://api.github.com/users/gniezen/followers","following_url":"https://api.github.com/users/gniezen/following{/other_user}","gists_url":"https://api.github.com/users/gniezen/gists{/gist_id}","starred_url":"https://api.github.com/users/gniezen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gniezen/subscriptions","organizations_url":"https://api.github.com/users/gniezen/orgs","repos_url":"https://api.github.com/users/gniezen/repos","events_url":"https://api.github.com/users/gniezen/events{/privacy}","received_events_url":"https://api.github.com/users/gniezen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-11-22T11:43:12Z","updated_at":"2018-02-05T16:43:35Z","closed_at":"2018-02-05T16:43:35Z","author_association":"NONE","body":"- __SerialPort Version__: 6.0.4\r\n- __NodeJS Version__: 7.9.0 (Electron)\r\n- __Operating System__ and __Hardware Platform__: Windows 10 32-bit\r\n\r\n- Have you checked the right __version__ of the __api docs?__: Yes\r\n- Are you having trouble installing and you checked the __Installation Special Cases__ docs? No\r\n- Are you using __Electron__ and have you checked the _Electron Docs_?: Yes\r\n\r\n### Summary of Problem\r\n\r\nAfter upgrading from v4.0.7 to v6.0.4, we are experiencing intermittent cases of `port.write()` not returning on Windows. macOS works fine. v5.0.0 works fine too, but v6.0.0 produces a `Writing to COM port (WriteFileEx): The parameter is incorrect` error. v6.0.4 continues past the stage where v6.0.0 errored out, but stalls later in the process, where it does not produce an error but also does not return, so the event loop hangs. Maybe this is still related to #1363?\r\n\r\n### Steps and Code to Reproduce the Issue\r\n\r\nIt seems to occur when there are multiple writes. My guess is that the first write is still pending when we do the next write, but shouldn't v6.0.4 return a \"pending\" error in this instance? And why is this only an issue on Windows?\r\n\r\nI've tried `port.drain()` after every `port.write()`, but that doesn't resolve the issue either. If I put the `port.drain` _in front of_ the `port.write()`, it hangs while draining.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/node-serialport/node-serialport/issues/comments/363143380","html_url":"https://github.com/node-serialport/node-serialport/issues/1403#issuecomment-363143380","issue_url":"https://api.github.com/repos/node-serialport/node-serialport/issues/1403","id":363143380,"user":{"login":"reconbot","id":25966,"avatar_url":"https://avatars2.githubusercontent.com/u/25966?v=4","gravatar_id":"","url":"https://api.github.com/users/reconbot","html_url":"https://github.com/reconbot","followers_url":"https://api.github.com/users/reconbot/followers","following_url":"https://api.github.com/users/reconbot/following{/other_user}","gists_url":"https://api.github.com/users/reconbot/gists{/gist_id}","starred_url":"https://api.github.com/users/reconbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reconbot/subscriptions","organizations_url":"https://api.github.com/users/reconbot/orgs","repos_url":"https://api.github.com/users/reconbot/repos","events_url":"https://api.github.com/users/reconbot/events{/privacy}","received_events_url":"https://api.github.com/users/reconbot/received_events","type":"User","site_admin":false},"created_at":"2018-02-05T16:43:35Z","updated_at":"2018-02-05T16:43:35Z","author_association":"COLLABORATOR","body":"I'm going to close this issue due to it's age, but if you'd like to continue with it feel free to comment and we'll reopen."}}
{"actor":{"display_login":"reconbot"}}