{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/1897","repository_url":"https://api.github.com/repos/micropython/micropython","labels_url":"https://api.github.com/repos/micropython/micropython/issues/1897/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/1897/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/1897/events","html_url":"https://github.com/micropython/micropython/issues/1897","id":140526232,"node_id":"MDU6SXNzdWUxNDA1MjYyMzI=","number":1897,"title":"ESP8266 - OSError 12 after processing requests for a while with lwip sockets","user":{"login":"wendlers","id":1392340,"node_id":"MDQ6VXNlcjEzOTIzNDA=","avatar_url":"https://avatars1.githubusercontent.com/u/1392340?v=4","gravatar_id":"","url":"https://api.github.com/users/wendlers","html_url":"https://github.com/wendlers","followers_url":"https://api.github.com/users/wendlers/followers","following_url":"https://api.github.com/users/wendlers/following{/other_user}","gists_url":"https://api.github.com/users/wendlers/gists{/gist_id}","starred_url":"https://api.github.com/users/wendlers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wendlers/subscriptions","organizations_url":"https://api.github.com/users/wendlers/orgs","repos_url":"https://api.github.com/users/wendlers/repos","events_url":"https://api.github.com/users/wendlers/events{/privacy}","received_events_url":"https://api.github.com/users/wendlers/received_events","type":"User","site_admin":false},"labels":[{"id":346835615,"node_id":"MDU6TGFiZWwzNDY4MzU2MTU=","url":"https://api.github.com/repos/micropython/micropython/labels/esp8266","name":"esp8266","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-03-13T20:30:45Z","updated_at":"2018-10-02T09:56:10Z","closed_at":null,"author_association":"NONE","body":"I tried to implement a very simple server with lwip sockets. The test script below runs for a while as expected, but then terminates with OSError 12 (cannot allocate memory?). \n\nVersions used (one ESP826612E NodeMCU):\n\n```\n>>> import os\n>>> os.uname()\n(sysname='ESP8266', nodename='ESP8266', release='1.5.2(80914727)', version='v1.6-217-g99fc0d1-dirty on 2016-03-13', machine='ESP module with ESP8266')\n```\n\nScript used on the ESP:\n\n```\nimport lwip\n\nsrv = lwip.socket()\nsrv.bind((\"\", 80))\nsrv.listen(0)\n\ncnt = 0\n\nprint(\"server started\")\n\nreshdr = \"HTTP/1.1 200 OK\\r\\nConnection: close\\r\\n\" \n\ntry: \n\n    while True:\n\n        cli, addr = srv.accept()\n\n        print(cnt, addr)\n        cnt += 1\n\n        inp = cli.read(128)\n        cli.send(\"HTTP/1.1 200 OK\\r\\nConnection: close\\r\\n\")    \n        cli.close()\n\nexcept OSError as e:\n\n    print(\"Failed with OSError %s after %d requests\" % (e, cnt))\n```\n\nScript used  on the client machine:\n\n```\nwhile true; do curl http://192.168.1.126/; done\n```\n\nThe result of the script repeatedly is:\n\n```\nserver started\n0 ('192.168.1.113', 40546)\n1 ('192.168.1.113', 40548)\n2 ('192.168.1.113', 40550)\n...\n37 ('192.168.1.113', 40620)\n38 ('192.168.1.113', 40622)\n39 ('192.168.1.113', 40624)\nFailed with OSError 12 after 40 requests\n```\n"},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/426216935","html_url":"https://github.com/micropython/micropython/issues/1897#issuecomment-426216935","issue_url":"https://api.github.com/repos/micropython/micropython/issues/1897","id":426216935,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjIxNjkzNQ==","user":{"login":"delivrance","id":14043624,"node_id":"MDQ6VXNlcjE0MDQzNjI0","avatar_url":"https://avatars3.githubusercontent.com/u/14043624?v=4","gravatar_id":"","url":"https://api.github.com/users/delivrance","html_url":"https://github.com/delivrance","followers_url":"https://api.github.com/users/delivrance/followers","following_url":"https://api.github.com/users/delivrance/following{/other_user}","gists_url":"https://api.github.com/users/delivrance/gists{/gist_id}","starred_url":"https://api.github.com/users/delivrance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delivrance/subscriptions","organizations_url":"https://api.github.com/users/delivrance/orgs","repos_url":"https://api.github.com/users/delivrance/repos","events_url":"https://api.github.com/users/delivrance/events{/privacy}","received_events_url":"https://api.github.com/users/delivrance/received_events","type":"User","site_admin":false},"created_at":"2018-10-02T09:56:10Z","updated_at":"2018-10-02T09:56:10Z","author_association":"NONE","body":"@peterhinch Yes, but doesn't seem to be helping, at all."}}
{"actor":{"display_login":"delivrance"}}