{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/2402","repository_url":"https://api.github.com/repos/micropython/micropython","labels_url":"https://api.github.com/repos/micropython/micropython/issues/2402/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/2402/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/2402/events","html_url":"https://github.com/micropython/micropython/issues/2402","id":175569184,"number":2402,"title":"WiPy/CC3200: usocket.socket.settimeout() not working?","user":{"login":"dmartauz","id":11318520,"avatar_url":"https://avatars1.githubusercontent.com/u/11318520?v=3","gravatar_id":"","url":"https://api.github.com/users/dmartauz","html_url":"https://github.com/dmartauz","followers_url":"https://api.github.com/users/dmartauz/followers","following_url":"https://api.github.com/users/dmartauz/following{/other_user}","gists_url":"https://api.github.com/users/dmartauz/gists{/gist_id}","starred_url":"https://api.github.com/users/dmartauz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmartauz/subscriptions","organizations_url":"https://api.github.com/users/dmartauz/orgs","repos_url":"https://api.github.com/users/dmartauz/repos","events_url":"https://api.github.com/users/dmartauz/events{/privacy}","received_events_url":"https://api.github.com/users/dmartauz/received_events","type":"User","site_admin":false},"labels":[{"id":73963833,"url":"https://api.github.com/repos/micropython/micropython/labels/ports","name":"ports","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":{"login":"danicampora","id":7749335,"avatar_url":"https://avatars2.githubusercontent.com/u/7749335?v=3","gravatar_id":"","url":"https://api.github.com/users/danicampora","html_url":"https://github.com/danicampora","followers_url":"https://api.github.com/users/danicampora/followers","following_url":"https://api.github.com/users/danicampora/following{/other_user}","gists_url":"https://api.github.com/users/danicampora/gists{/gist_id}","starred_url":"https://api.github.com/users/danicampora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danicampora/subscriptions","organizations_url":"https://api.github.com/users/danicampora/orgs","repos_url":"https://api.github.com/users/danicampora/repos","events_url":"https://api.github.com/users/danicampora/events{/privacy}","received_events_url":"https://api.github.com/users/danicampora/received_events","type":"User","site_admin":false},"assignees":[{"login":"danicampora","id":7749335,"avatar_url":"https://avatars2.githubusercontent.com/u/7749335?v=3","gravatar_id":"","url":"https://api.github.com/users/danicampora","html_url":"https://github.com/danicampora","followers_url":"https://api.github.com/users/danicampora/followers","following_url":"https://api.github.com/users/danicampora/following{/other_user}","gists_url":"https://api.github.com/users/danicampora/gists{/gist_id}","starred_url":"https://api.github.com/users/danicampora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danicampora/subscriptions","organizations_url":"https://api.github.com/users/danicampora/orgs","repos_url":"https://api.github.com/users/danicampora/repos","events_url":"https://api.github.com/users/danicampora/events{/privacy}","received_events_url":"https://api.github.com/users/danicampora/received_events","type":"User","site_admin":false}],"milestone":null,"comments":12,"created_at":"2016-09-07T18:06:44Z","updated_at":"2017-06-22T07:36:14Z","closed_at":null,"body":"According to the doc:\nSet a timeout on blocking socket operations. The value argument can be a nonnegative floating point number expressing seconds, or None. If a non-zero value is given, subsequent socket operations will raise a timeout exception if the timeout period value has elapsed before the operation has completed. If zero is given, the socket is put in non-blocking mode. If None is given, the socket is put in blocking mode.\n`http://micropython.org/resources/docs/en/latest/wipy/library/usocket.html#usocket.socket.settimeout`\n\nIt obviously throws an error:\n`>>> s.settimeout(5.0)\nTraceback (most recent call last):\n  File \"<stdin>\", line 1\nSyntaxError: decimal numbers not supported\n`\nI was not successful with int parameter. Parameter was accepted, but there is no timeout happening for usocket.socket.accept().\n"},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/310300820","html_url":"https://github.com/micropython/micropython/issues/2402#issuecomment-310300820","issue_url":"https://api.github.com/repos/micropython/micropython/issues/2402","id":310300820,"user":{"login":"dmartauz","id":11318520,"avatar_url":"https://avatars1.githubusercontent.com/u/11318520?v=3","gravatar_id":"","url":"https://api.github.com/users/dmartauz","html_url":"https://github.com/dmartauz","followers_url":"https://api.github.com/users/dmartauz/followers","following_url":"https://api.github.com/users/dmartauz/following{/other_user}","gists_url":"https://api.github.com/users/dmartauz/gists{/gist_id}","starred_url":"https://api.github.com/users/dmartauz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmartauz/subscriptions","organizations_url":"https://api.github.com/users/dmartauz/orgs","repos_url":"https://api.github.com/users/dmartauz/repos","events_url":"https://api.github.com/users/dmartauz/events{/privacy}","received_events_url":"https://api.github.com/users/dmartauz/received_events","type":"User","site_admin":false},"created_at":"2017-06-22T07:36:14Z","updated_at":"2017-06-22T07:36:14Z","body":"@dpgeorge  I can confirm that timeout works for accept operation for me.\r\n`MicroPython v1.9.1-36-gd94bc67-dirty on 2017-06-22; WiPy with CC3200\r\nType \"help()\" for more information.\r\n>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\n>>> s.settimeout(5)\r\n>>> s.bind(('', 80))\r\n>>> s.listen(5)\r\n>>> conn, addr = s.accept()\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\nOSError: [Errno 110] ETIMEDOUT\r\n`\r\nI will test it more during next week together with read/receive and will let you know if there are any more issues."}}
{"actor":{"display_login":"dmartauz"}}