Websocket2 (23.01.02)Spring ํ๋ ์์ํฌ: ์น์์ผ์ ์ด์ฉํ ์ฑํ ํ๋ก๊ทธ๋จ ๋ง๋ค๊ธฐ โโ ์น์์ผโโ - Thymeleaf, Websocket - HttpSession ์ ๋ฌ(Controller -> WebSocket) - Interceptor ๋ฐฉ์์ผ๋ก ServletContext ์ ๋ฌ - page, request, session, application - application : ์น์๋ฒ์ ํ๊ฐ๋ง ์กด์ฌ - application = ServletContext - Controller์์ ServletContext ์ HttpSession์ ์ฐธ์กฐ๋ฅผ ์ ์ฅ - ์ธํฐ์ ํฐ๋ฅผ ํตํด ServletContext ๋ฅผ WebSocket์ผ๋ก ์ ๋ฌ - WebSocket์์๋ WebSocketSession์ ํตํด์ ์ ๋ฌ๋ ์์ฑ ๊ฐ์ ์ถ์ถํ ์ ์๋ค - WebSocket์์๋ ๋จผ์ ServletContext๋ฅผ ์ถ์ถํ๊ณ .. Framework/Spring Framework 2023. 1. 2. (22.12.30)Spring ํ๋ ์์ํฌ:WebSocket์ ์ฌ์ฉํ ์ฑํ ํ๋ก๊ทธ๋จ ๋ง๋ค๊ธฐ WebSocket์ ์ฌ์ฉํ ์ฑํ ํ๋ก๊ทธ๋จ ๋ง๋ค๊ธฐ - Spring boot ๊ธฐ๋ฐ ๊ณ ์์ค - ์น์ฌ์ดํธ ์ ์์ ์ ์ฒด๋ฅผ ๋์์ผ๋ก ํ ์ฑํ - ํน์ ์ด์ฉ์ ๊ทธ๋ฃน/๊ฐ์ธ์ ๋์์ผ๋ก ํ ์ฑํ (์์ฉ ์์: ์ฑ๋ด , ์ฑํ ) -์น ์๋ฒ์์ ์๋ฒ ์์ผ์ ๋๊ณ ์น๋ธ๋ผ์ฐ์ ๊ฐ ์๋ฒ์์ผ์ ์ ์์์ฒญํ๋ ๊ฐ๋ (์น์๋ฒ-์น๋ธ๋ผ์ฐ์ ๊ฐ์ ํต์ ) -http ํ๋กํ ์ฝ์ ์ ์์์ฒญ ํ ์ ์๋๋ฉด ์๋ต์ ์ ์กํ๊ณ ์ ์ ํด์ ServerSocket : ๋คํธ์์๋ฒ, ๋ฌดํํ ํด๋ผ์ด์ธํธ๋ฅผ ๋๊ธฐํจ Socket : ์๋ฒ์ ์ ์ ์์ฒญ์ ํ ์ ์๋ ๊ธฐ๋ฅ์ด ์๋ค. ํต์ ๊ธฐ๋ฅ์ด ๋ค์ด์๋ค.(์๋ฐ ๊ฒฝ์ฐ) ์ ์์ค์ ์์ผ๊ณผ ์๋ฒ์์ผ ๋ง๊ณ ๊ณ ์์ค์ ์น์์ผ์ ์ฌ์ฉํ์ฌ ํ๋ก๊ทธ๋๋ฐํ๊ธฐ ์น ์์ผ ์ค์ ํ๊ธฐ - main Class 1 2 3 4 5 6 7 8 9 10 11 12 13 1.. Framework/Spring Framework 2022. 12. 30. ์ด์ 1 ๋ค์