{"id":1262,"date":"2017-07-18T18:12:28","date_gmt":"2017-07-18T09:12:28","guid":{"rendered":"http:\/\/blog.moramcnt.com\/?p=1262"},"modified":"2017-07-18T18:12:28","modified_gmt":"2017-07-18T09:12:28","slug":"websocket-%ec%82%ac%ec%9a%a9%ec%8b%9c-%ec%97%b0%ea%b2%b0%ec%9d%84-%ec%a7%80%ec%86%8d%ed%95%b4%ec%95%bc-%ed%95%98%eb%8a%94-%ea%b2%bd%ec%9a%b0","status":"publish","type":"post","link":"http:\/\/blog.moramcnt.com\/?p=1262","title":{"rendered":"WebSocket \uc0ac\uc6a9\uc2dc \uc5f0\uacb0\uc744 \uc9c0\uc18d\ud574\uc57c \ud558\ub294 \uacbd\uc6b0"},"content":{"rendered":"<p>\uc6f9\uc18c\ucf13 \uc0ac\uc6a9\uc2dc \uc811\uc18d\ud55c\ud6c4 \uc77c\uc815\uc2dc\uac04\uc774 \uc9c0\ub098\uba74 \ud074\ub77c\uc5b8\ud2b8\uc5d0\uac8c \uc811\uc18d\uc885\ub8cc \uc774\ubca4\ud2b8\uac00 \uc989\uc2dc \ub0a0\ub77c\uc640\uc57c\ud558\uc9c0\ub9cc, \ubc14\ub85c \ub0a0\ub77c\uc624\uc9c0\ub294 \uc54a\uc544<br \/>\n\uc774\ubca4\ud2b8 \ucc98\ub9ac\uc2dc \uc560\ub97c \uba39\ub294 \uacbd\uc6b0\uac00 \uac04\uac04\ud788 \uc788\ub2e4.<br \/>\n\ub530\ub77c\uc11c  \uc774\ub54c\ub294 \ud478\uc2dc\uc11c\ubc84\uc5d0\uc11c \ucc98\ub7fc HeartBeat \uccb4\ud06c\ub97c \ud574\uc8fc\uc5b4\uc57c \ud55c\ub2e4.<\/p>\n<p>\uc544\ub798 \ucf54\ub4dc\ub294 setHeartbeatTime \uc744 \ub123\uc5b4 HeartBeat \uccb4\ud06c\ub97c \ud55c \uacbd\uc6b0\uc774\ub2e4.<\/p>\n<pre>\r\n@Configuration\r\n@EnableWebMvc\r\n@EnableWebSocket\r\npublic class WsConfig extends WebMvcConfigurerAdapter implements WebSocketConfigurer\r\n{\r\n\t@Override\r\n\tpublic void registerWebSocketHandlers(WebSocketHandlerRegistry wshrRegistry)\r\n\t{\r\n\t\twshrRegistry.addHandler(getWsMsgHandler(), \"\/ws\/msgHandler.sockjs\")\r\n\t\t\t.addInterceptors(new WsHandshakeInterceptor())\r\n\t\t\t.withSockJS().setHeartbeatTime(2000);\r\n\t}\r\n\r\n\t@Bean\r\n\tpublic WsMsgHandler getWsMsgHandler()\r\n\t{\r\n\t\treturn new WsMsgHandler();\r\n\t}\r\n\r\n    @Override\r\n    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)\r\n    {\r\n        configurer.enable();\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uc6f9\uc18c\ucf13 \uc0ac\uc6a9\uc2dc \uc811\uc18d\ud55c\ud6c4 \uc77c\uc815\uc2dc\uac04\uc774 \uc9c0\ub098\uba74 \ud074\ub77c\uc5b8\ud2b8\uc5d0\uac8c \uc811\uc18d\uc885\ub8cc \uc774\ubca4\ud2b8\uac00 \uc989\uc2dc \ub0a0\ub77c\uc640\uc57c\ud558\uc9c0\ub9cc, \ubc14\ub85c \ub0a0\ub77c\uc624\uc9c0\ub294 \uc54a\uc544 \uc774\ubca4\ud2b8 \ucc98\ub9ac\uc2dc \uc560\ub97c \uba39\ub294 \uacbd\uc6b0\uac00 \uac04\uac04\ud788 \uc788\ub2e4. \ub530\ub77c\uc11c \uc774\ub54c\ub294 \ud478\uc2dc\uc11c\ubc84\uc5d0\uc11c \ucc98\ub7fc HeartBeat \uccb4\ud06c\ub97c \ud574\uc8fc\uc5b4\uc57c \ud55c\ub2e4. \uc544\ub798 \ucf54\ub4dc\ub294 setHeartbeatTime \uc744 \ub123\uc5b4 HeartBeat \uccb4\ud06c\ub97c \ud55c \uacbd\uc6b0\uc774\ub2e4. @Configuration @EnableWebMvc @EnableWebSocket public class WsConfig extends WebMvcConfigurerAdapter implements WebSocketConfigurer { @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry wshrRegistry) { wshrRegistry.addHandler(getWsMsgHandler(), [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[6,4],"tags":[217,199],"class_list":["post-1262","post","type-post","status-publish","format-standard","hentry","category-java","category-4","tag-setheartbeattime","tag-websocket"],"_links":{"self":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/1262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1262"}],"version-history":[{"count":2,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/1262\/revisions"}],"predecessor-version":[{"id":1264,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/1262\/revisions\/1264"}],"wp:attachment":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1262"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}