{"id":1092,"date":"2010-07-02T17:44:48","date_gmt":"2010-07-02T16:44:48","guid":{"rendered":"http:\/\/soci.hu\/blog\/?p=1092"},"modified":"2010-07-02T17:44:48","modified_gmt":"2010-07-02T16:44:48","slug":"blocking-read-kivaltasa-mivel","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2010\/07\/02\/blocking-read-kivaltasa-mivel\/","title":{"rendered":"Blocking read kiv\u00e1lt\u00e1sa mivel?"},"content":{"rendered":"<p>Tegy\u00fck fel \u00edrok egy tcp kliens programot, TcpClient, NetworkStream \u00e9s t\u00e1rsaival. A NetworkStream.Read blokkol\u00f3 m\u00f3don m\u0171k\u00f6dik. Nekem az kell, hogy b\u00e1rmikor tudjam abort\u00e1lni a tcp csatorn\u00e1t. A Read ha miatta beragad az egy sz\u00e1l, az Thread.Abort \u00e1ll\u00edtja le (igaz, az Thread.Interruptot m\u00e9g nem pr\u00f3b\u00e1ltam).<\/p>\n<p>Lehets\u00e9ges megold\u00e1sk\u00e9nt az async BeginReadet javasolj\u00e1k, de azzal meg az a bajom, hogy minden kis darab olvas\u00e1sa ut\u00e1n egy waithandlere kell v\u00e1rni, ami meg context switchet eredm\u00e9nyez, \u00edgy a nagysebess\u00e9g\u0171 id\u0151szakokban belass\u00edt.<br \/>\nMi vajon a korrekt megold\u00e1s, ami megszak\u00edthat\u00f3 \u00e9s gyors is?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tegy\u00fck fel \u00edrok egy tcp kliens programot, TcpClient, NetworkStream \u00e9s t\u00e1rsaival. A NetworkStream.Read blokkol\u00f3 m\u00f3don m\u0171k\u00f6dik. Nekem az kell, hogy b\u00e1rmikor tudjam&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4],"tags":[],"class_list":["post-1092","post","type-post","status-publish","format-standard","hentry","category-net","category-szakmai-elet"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1092"}],"version-history":[{"count":1,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1092\/revisions"}],"predecessor-version":[{"id":1093,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1092\/revisions\/1093"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}