{"action":"created","issue":{"url":"https://api.github.com/repos/winddriver/Delphi-Cross-Socket/issues/11","repository_url":"https://api.github.com/repos/winddriver/Delphi-Cross-Socket","labels_url":"https://api.github.com/repos/winddriver/Delphi-Cross-Socket/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/winddriver/Delphi-Cross-Socket/issues/11/comments","events_url":"https://api.github.com/repos/winddriver/Delphi-Cross-Socket/issues/11/events","html_url":"https://github.com/winddriver/Delphi-Cross-Socket/issues/11","id":278238309,"node_id":"MDU6SXNzdWUyNzgyMzgzMDk=","number":11,"title":"Received data corruption with EPoll on Android and Linux ","user":{"login":"allendrennan","id":9138571,"node_id":"MDQ6VXNlcjkxMzg1NzE=","avatar_url":"https://avatars3.githubusercontent.com/u/9138571?v=4","gravatar_id":"","url":"https://api.github.com/users/allendrennan","html_url":"https://github.com/allendrennan","followers_url":"https://api.github.com/users/allendrennan/followers","following_url":"https://api.github.com/users/allendrennan/following{/other_user}","gists_url":"https://api.github.com/users/allendrennan/gists{/gist_id}","starred_url":"https://api.github.com/users/allendrennan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allendrennan/subscriptions","organizations_url":"https://api.github.com/users/allendrennan/orgs","repos_url":"https://api.github.com/users/allendrennan/repos","events_url":"https://api.github.com/users/allendrennan/events{/privacy}","received_events_url":"https://api.github.com/users/allendrennan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-11-30T19:19:11Z","updated_at":"2018-08-28T14:38:40Z","closed_at":null,"author_association":"NONE","body":"It is possible to corrupt the recv data stream on Android and Linux using the Epoll because more than one I/O thread could be processing a Read operation simultaneously.  This is because a call to [TIoEvent.Read, TIoEvent.Write] is issued.  This can cause OpenSSL to fail with a corrupted datastream because the order of calls to TriggerReceived() may be different than the order of calls to _HandleRead because 2 threads are processing a Read at the same time.  A workaround is to have a special ReadLock in the Epoll class for _HandleRead so that a one-to-one match between calls to _HandleRead and TriggerReceived happens."},"comment":{"url":"https://api.github.com/repos/winddriver/Delphi-Cross-Socket/issues/comments/416610632","html_url":"https://github.com/winddriver/Delphi-Cross-Socket/issues/11#issuecomment-416610632","issue_url":"https://api.github.com/repos/winddriver/Delphi-Cross-Socket/issues/11","id":416610632,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjYxMDYzMg==","user":{"login":"HeZiHang","id":4093295,"node_id":"MDQ6VXNlcjQwOTMyOTU=","avatar_url":"https://avatars0.githubusercontent.com/u/4093295?v=4","gravatar_id":"","url":"https://api.github.com/users/HeZiHang","html_url":"https://github.com/HeZiHang","followers_url":"https://api.github.com/users/HeZiHang/followers","following_url":"https://api.github.com/users/HeZiHang/following{/other_user}","gists_url":"https://api.github.com/users/HeZiHang/gists{/gist_id}","starred_url":"https://api.github.com/users/HeZiHang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeZiHang/subscriptions","organizations_url":"https://api.github.com/users/HeZiHang/orgs","repos_url":"https://api.github.com/users/HeZiHang/repos","events_url":"https://api.github.com/users/HeZiHang/events{/privacy}","received_events_url":"https://api.github.com/users/HeZiHang/received_events","type":"User","site_admin":false},"created_at":"2018-08-28T14:38:40Z","updated_at":"2018-08-28T14:38:40Z","author_association":"NONE","body":"由于此框架的架构问题，大量包接收时会出现乱序接收现象，这是很难避免。\r\n除非每个线程有各自的Epoll或iocp或kqueue。而且每个Socket绑定在一个io队列（即一个socket所有的IO仅由某一个线程来处理）才能避免粘包现象。"}}
{"actor":{"display_login":"HeZiHang"}}