Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
WebSocketで遊んでみた / Go WebSocket
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
chikuwa111
May 28, 2018
Programming
2
630
WebSocketで遊んでみた / Go WebSocket
Gopher道場#1 LT大会で発表した資料になります。実際に発表した資料に少し手を加えてあります。
chikuwa111
May 28, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
SourceGeneratorのススメ
htkym
0
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
550
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
CSC307 Lecture 03
javiergs
PRO
1
490
Oxlint JS plugins
kazupon
1
890
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
230
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
CSC307 Lecture 02
javiergs
PRO
1
780
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
270
Data-Centric Kaggle
isax1015
2
770
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
110
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
We Have a Design System, Now What?
morganepeng
54
8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Paper Plane
katiecoart
PRO
0
46k
The Pragmatic Product Professional
lauravandoore
37
7.1k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
93
First, design no harm
axbom
PRO
2
1.1k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
700
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Typedesign – Prime Four
hannesfritz
42
2.9k
Rails Girls Zürich Keynote
gr2m
96
14k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
Transcript
8FC4PDLFUͰ༡ΜͰΈͨ ྠढ़Ұ
ࣗݾհ w ྠढ़Ұ ͚ͨΘ w େֶੜ w ʮͪ͘ΘʯͱݺΕͯ·͢ w
ॳ-5
8FC4PDLFUͰ༡ΜͰΈͨ
(Pͷ8FC4PDLFUࣄ w HPMBOHPSHYOFUXFCTPDLFU w 5IJTQBDLBHFDVSSFOUMZMBDLTTPNFGFBUVSFT GPVOEJOBMUFSOBUJWFBOENPSFBDUJWFMZNBJOUBJOFE 8FC4PDLFUQBDLBHF w HJUIVCDPNHPSJMMBXFCTPDLFU
HPSJMMBXFCTPDLFU w 4FOEDMPTFNFTTBHF w 4FOEQJOHTBOESFDFJWFQPOHT w $PNQSFTTJPO &YQFSJNFOUBM w
3FBENFTTBHFVTJOHJP3FBEFS w 8SJUFNFTTBHFVTJOHJP8SJUF$MPTFS
func Echo(ws *websocket.Conn) { for { var reply string if
err := websocket.Message.Receive(ws, &reply); err != nil { fmt.Println("Receive failed: ", err) break } if err := websocket.Message.Send(ws, reply); err != nil { fmt.Println("Send failed: ", err) break } } } func main() { http.Handle("/", websocket.Handler(Echo)) if err := http.ListenAndServe(":8080", nil); err != nil { log.Fatal("ListenAndServe:", err) } }
༡ΜͰΈͨ νϟοτػೳ
IFSPLVʹ͋͛·ͨ͠ 63-ൿີ
ͭͬͨ͘ͷ w ͨͩͷνϟοτػೳ w શମͰͻͱͭͷ෦Λڞ༗͍ͯ͠Δ w HJUIVCDPNHPSJMMBXFCTPDLFUUSFFNBTUFS FYBNQMFTDIBUΛࢀߟʹ͠·ͨ͠
ͭͬͨ͘ͷ )6# ೖࣨɾୀࣨɾ ϝοηʔδͷཧ 4FSWFS ड৴ͷཧ ૹ৴ͷཧ JOJU QFSDPOOFDUJPO
ຊʹΓ͔ͨͬͨ͜ͱ
ෳͷ෦Λͭ͘Δ )6# ೖࣨɾୀࣨɾ ϝοηʔδͷཧ 4FSWFS ड৴ͷཧ ૹ৴ͷཧ QFSDPOOFDUJPO
ཁղܾϙΠϯτ w ෦ͷཧ w ೖࣨͷड͚ೖΕঢ়ଶͷཧ w ਓͷ෦ͷআ w ύϑΥʔϚϯεͷ࠷దԽ
͋Γ͕ͱ͏͍͟͝·ͨ͠