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
実録mruby組み込み体験
Search
Misaki Shioi(塩井美咲/しおい)
May 11, 2022
Programming
0
2.1k
実録mruby組み込み体験
Fukuoka.rb 0x100 回 LT 大会 (#256)
Misaki Shioi(塩井美咲/しおい)
May 11, 2022
Tweet
Share
More Decks by Misaki Shioi(塩井美咲/しおい)
See All by Misaki Shioi(塩井美咲/しおい)
XPE2-bookclub Explained
coe401_
0
80
Some more adventure of Happy Eyeballs
coe401_
2
260
Introduction of Happy Eyeballs Version 2 (RFC8305) to the Socket library
coe401_
1
340
An adventure of Happy Eyeballs
coe401_
3
9.8k
Implementing "++" operator, stepping into parse.y
coe401_
4
12k
たのしいRubyの構文解析ツアー
coe401_
6
3.8k
Ruby (MRI) の好きなところ 30
coe401_
1
860
Packet analysis with mruby on Wireshark - dRuby as example
coe401_
3
3.3k
Toycol: Define your own application protocol
coe401_
2
2.1k
Other Decks in Programming
See All in Programming
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1k
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
100
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
130
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
430
快速入門可觀測性
blueswen
0
370
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.7k
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
100
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Docker and Python
trallard
42
3.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Code Reviewing Like a Champion
maltzj
520
39k
Visualization
eitanlees
146
15k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Designing Experiences People Love
moore
138
23k
Statistics for Hackers
jakevdp
796
220k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Making Projects Easy
brettharned
116
5.9k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Transcript
ԘҪඒ࡙ TIJPJNN!DPF@ 'VLVPLBSCYճ-5େձ ࣮ NSVCZΈࠐΈମݧ
aaॕ'VLVPLBSC։࠵
ࣗݾհ ԘҪඒ࡙ ͓͍͠ (JU)VC!TIJPJNN 5XJUUFS!DPF@ 'VLVPLBSCͱ"TBLVTBSCʹ͍ΔNSVCZॳֶऀ ࠷ۙͷग़དྷࣄɿࡢѪ༻ͷ؟ڸΛഁյ͠·ͨ͠
NSVCZͱ Ҿ༻IUUQTHJUIVCDPNNSVCZNSVCZXIBUJTNSVCZ NSVCZJTUIFMJHIUXFJHIUJNQMFNFOUBUJPOPGUIF3VCZMBOHVBHF DPNQMZJOHUP QBSUPG UIF*40TUBOEBSE*UTTZOUBYJT3VCZY DPNQBUJCMF NSVCZDBOCFMJOLFEBOEFNCFEEFEXJUIJOZPVSBQQMJDBUJPO8F QSPWJEFUIFJOUFSQSFUFSQSPHSBNNSVCZ BOEUIFJOUFSBDUJWFNSVCZ
TIFMMNJSCBTFYBNQMFT:PVDBOBMTPDPNQJMF3VCZQSPHSBNTJOUP DPNQJMFECZUFDPEFVTJOHUIFNSVCZDPNQJMFSlNSCDz
NSVCZͱ Ҿ༻IUUQTHJUIVCDPNNSVCZNSVCZXIBUJTNSVCZ NSVCZJTUIFMJHIUXFJHIUJNQMFNFOUBUJPOPGUIF3VCZMBOHVBHF DPNQMZJOHUP QBSUPG UIF*40TUBOEBSE*UTTZOUBYJT3VCZY DPNQBUJCMF NSVCZDBOCFMJOLFEBOEFNCFEEFEXJUIJOZPVSBQQMJDBUJPO8F QSPWJEFUIFJOUFSQSFUFSQSPHSBNNSVCZ BOEUIFJOUFSBDUJWFNSVCZ
TIFMMNJSCBTFYBNQMFT:PVDBOBMTPDPNQJMF3VCZQSPHSBNTJOUP DPNQJMFECZUFDPEFVTJOHUIFNSVCZDPNQJMFSlNSCDz ʮNSVCZΞϓϦέʔγϣϯʹϦϯΫͯ͠ΈࠐΉ͜ͱ͕Ͱ͖Δʯ [
3VCZͰॻ͔Εͨιʔείʔυͱ $Ͱॻ͔ΕͨΞϓϦέʔγϣϯ͕͋Δͱ͖ɺ ΞϓϦέʔγϣϯ $ 3VCZ ʮNSVCZΛΞϓϦέʔγϣϯʹΈࠐΉʯΠϝʔδ
3VCZͰॻ͔ΕͨॲཧΛΞϓϦέʔγϣϯίʔυʹຒΊࠐΈɺ ΞϓϦέʔγϣϯ $ 3VCZ ʮNSVCZΛΞϓϦέʔγϣϯʹΈࠐΉʯΠϝʔδ 3VCZ
ຒΊࠐΜͩॲཧ͝ͱΞϓϦέʔγϣϯΛ࣮ߦ͢Δ ΞϓϦέʔγϣϯ $ 3VCZ ʮNSVCZΛΞϓϦέʔγϣϯʹΈࠐΉʯΠϝʔδ 3VCZ
NSVCZΛ$ΞϓϦέʔγϣϯʹΈࠐΉํ๏͍Ζ͍Ζ &YFDVUJOH3VCZDPEFXJUINSVCZ IUUQTNSVCZPSHEPDTBSUJDMFTFYFDVUJOHSVCZDPEFXJUINSVCZIUNM
NSVCZΛ$ΞϓϦέʔγϣϯʹΈࠐΉํ๏͍Ζ͍Ζ ΞϓϦέʔγϣϯίʔυͰNSVCZͷ$"1*Λհͯ͠ 3VCZͷιʔείʔυΛ࣮ߦ͢Δํ๏ 3VCZ ΞϓϦέʔγϣϯ $
NSVCZΛ$ΞϓϦέʔγϣϯʹΈࠐΉํ๏͍Ζ͍Ζ ιʔείʔυ 3VCZ Λݩʹ$ͷؔΛ࡞͠ɺ ΞϓϦέʔγϣϯίʔυ͔ΒJODMVEFͯ͠ݺͼग़͢ํ๏ 3VCZ ΞϓϦέʔγϣϯ $ $
$
NSVCZΛ$ΞϓϦέʔγϣϯʹΈࠐΉํ๏͍Ζ͍Ζ ιʔείʔυ 3VCZ ͔ΒόΠτίʔυ͕هड़͞ΕͨϑΝΠϧΛ࡞ ΞϓϦέʔγϣϯίʔυ͔ΒಡΈࠐΉํ๏ ͳͲͳͲʜ 3VCZ ΞϓϦέʔγϣϯ $
όΠτίʔυ NSCD NSCD
ͬͯΈ·͠ΐ͏
ࠓճΔ͜ͱ ͋Δͱ͜Ζʹ$Ͱॻ͔Εͨ5$1Τίʔαʔόʔ͕ ΫϥΠΞϯτ αʔόʔ )FMMP )FMMP
ࠓճΔ͜ͱ αʔόʔ 5$1Τίʔαʔόʔ $ ͷ࣮ int main(void) { // αʔόʔΞυϨεใͷऔಘɹ
// ιέοτͷ࡞ // ϦΫΤετͷͪड͚ // ϦΫΤετͷड͚͚ // ϦΫΤετͷಡΈࠐΈ // Ϩεϙϯεͷૹ৴ // ιέοτͷഁغ return 0; }
ࠓճΔ͜ͱ int main(void) { // αʔόʔΞυϨεใͷऔಘɹ // ιέοτͷ࡞ // ϦΫΤετͷͪड͚
// ϦΫΤετͷड͚͚ // ϦΫΤετͷಡΈࠐΈ // Ϩεϙϯεͷૹ৴ // ιέοτͷഁغ return 0; } ⬅︎ ͜Ε͕ۤखͳͷͰ ɹ3VCZͰ αʔόʔ 5$1Τίʔαʔόʔ $ ͷ࣮
struct addrinfo server_addr_hints, *server_addr, *server_addr_tmp; int addrinfoerr; memset(&server_addr_hints, 0, sizeof(struct
addrinfo)); server_addr_hints.ai_family = AF_INET; server_addr_hints.ai_socktype = SOCK_STREAM; server_addr_hints.ai_ fl ags = AI_PASSIVE; if ((addrinfoerr = getaddrinfo(HOST, PORT, &server_addr_hints, &server_addr)) < 0) { gai_strerror(addrinfoerr); } <$ͷ߹>αʔόʔΞυϨεใऔಘ // ศ্ٓ"'@*/&5ʹ͍ͯ͠·͢
struct addrinfo server_addr_hints, *server_addr, *server_addr_tmp; int addrinfoerr; memset(&server_addr_hints, 0, sizeof(struct
addrinfo)); server_addr_hints.ai_family = AF_INET; server_addr_hints.ai_socktype = SOCK_STREAM; server_addr_hints.ai_ fl ags = AI_PASSIVE; if ((addrinfoerr = getaddrinfo(HOST, PORT, &server_addr_hints, &server_addr)) < 0) { gai_strerror(addrinfoerr); } <$ͷ߹>αʔόʔΞυϨεใऔಘ // ศ্ٓ"'@*/&5ʹ͍ͯ͠·͢ ᶃΞυϨεใͷώϯτΛ֨ೲ͢Δߏମͱ ɹΞυϨεใΛ֨ೲ͢ΔߏମͷͨΊͷϝϞϦྖҬΛ֬อ ᶄΞυϨεใͷώϯτΛ֨ೲ͢ΔߏମʹΞυϨεใͷώϯτΛ֨ೲ ᶅΞυϨεใͷώϯτΛ֨ೲͨ͠ߏମΛར༻ͯ͠ ɹ࠷ॳʹݟ͔ͭͬͨΞυϨεใΛΞυϨεใΛ֨ೲ͢Δߏମʹ֨ೲ ɹ˞͜ͷͱ͖ɺΞυϨεใϦϯΫϦετʹͳ͓ͬͯΓɺ ɹɹΞυϨεใΛ֨ೲ͢Δߏମଞʹར༻Ͱ͖ΔީิͱͳΔ ɹɹΞυϨεใͷϙΠϯλΛ͍࣋ͬͯΔ
int listener; for (server_addr_tmp = server_addr; server_addr_tmp; server_addr_tmp = server_addr_tmp->ai_next)
{ listener = socket(server_addr_tmp->ai_family, server_addr_tmp->ai_socktype, server_addr_tmp->ai_protocol); if (listener < 0) continue; if (bind(listener, server_addr_tmp->ai_addr, server_addr_tmp->ai_addrlen) < 0) { close(listener); continue; } break; } <$ͷ߹>αʔόʔΞυϨεใऔಘ
int listener; for (server_addr_tmp = server_addr; server_addr_tmp; server_addr_tmp = server_addr_tmp->ai_next)
{ listener = socket(server_addr_tmp->ai_family, server_addr_tmp->ai_socktype, server_addr_tmp->ai_protocol); if (listener < 0) continue; if (bind(listener, server_addr_tmp->ai_addr, server_addr_tmp->ai_addrlen) < 0) { close(listener); continue; } break; } <$ͷ߹>αʔόʔΞυϨεใऔಘ ᶆϦΫΤετΛͪड͚ΔιέοτͷͨΊͷϝϞϦྖҬΛ༻ҙ ᶇΞυϨεใΛ֨ೲ͢Δߏମ͕࣋ͭϦϯΫΛͨͲͬͯ ɹ͜ͷߏମͷҰ෦ͷใ͔ΒιέοτΛ࡞͠ɺ ɹߋʹ͜ͷߏମͷଞͷใ͔Β࣮ࡍʹΞυϨεͱόΠϯυͰ͖Δ͔ࢼΈΔ ᶈιέοτͷ࡞ͱΞυϨεͷόΠϯυʹޭͨ͠ΒιέοτΛฦ͢
int listener; for (server_addr_tmp = server_addr; server_addr_tmp; server_addr_tmp = server_addr_tmp->ai_next)
{ listener = socket(server_addr_tmp->ai_family, server_addr_tmp->ai_socktype, server_addr_tmp->ai_protocol); if (listener < 0) continue; if (bind(listener, server_addr_tmp->ai_addr, server_addr_tmp->ai_addrlen) < 0) { close(listener); continue; } break; } <$ͷ߹>αʔόʔΞυϨεใऔಘ ᶆϦΫΤετΛͪड͚ΔιέοτͷͨΊͷϝϞϦྖҬΛ༻ҙ ᶇΞυϨεใΛ֨ೲ͢Δߏମ͕࣋ͭϦϯΫΛͨͲͬͯ ɹ͜ͷߏମͷҰ෦ͷใ͔ΒιέοτΛ࡞͠ɺ ɹߋʹ͜ͷߏମͷଞͷใ͔Β࣮ࡍʹΞυϨεͱόΠϯυͰ͖Δ͔ࢼΈΔ ᶈιέοτͷ࡞ͱΞυϨεͷόΠϯυʹޭͨ͠ΒιέοτΛฦ͢ ➡︎ ͍͠ʜ ɹΞυϨεͷݕࡧͱιέοτͷ࡞Λಉ࣌ʹߦͬͯ ɹΞυϨεͷ༗ޮੑΛݕূ͢Δඞཁ͕͋Δ ޮ͕ѱ͍
Addrinfo.getaddrinfo('localhost', 12345, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_PASSIVE). fi rst <3VCZͷ߹>αʔόʔΞυϨεใऔಘ BEESJOGPSC
"EESJOGPΦϒδΣΫτΛͭ͘Δ͚ͩʂ "EESJOGPΦϒδΣΫτ͕༗ޮͳΞυϨεใΛ͍࣋ͬͯΔ
Addrinfo.getaddrinfo('localhost', 12345, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_PASSIVE). fi rst <3VCZͷ߹>αʔόʔΞυϨεใऔಘ BEESJOGPSC
͜ͷॲཧΛΤίʔαʔόʔͷ෦Ͱ࣮ߦ͠ɺ ιέοτΛ࡞͢Δ ฦΓͱͳΔ"EESJOGPΦϒδΣΫτ ͷΞυϨεใ Λར༻ͯ͠
3VCZιʔείʔυΛΤίʔαʔόʔʹΈࠐΉ ΤίʔαʔόʔʹJODMVEFͯؔ͠ͱ࣮ͯ͠ߦ͢Δ BEESJOGPSC "EESJOGPHFUBEESJOGP Τίʔαʔόʔ $ BEESJOGPD BEESJOGP
BEESJOGP લड़ͷ3VCZιʔείʔυΛݩʹ$ؔBEESJOGP Λ࡞͠ɺ
NSVCZ͕༻ҙ͍ͯ͠ΔNSCDίϚϯυΛར༻͢Δ͜ͱͰ $ؔBEESJOGP BEESJOGPD Λ؆୯ʹ࡞͢Δ͜ͱ͕Ͱ͖Δ ͜͏ͯ͠࡞ͨ͠BEESJOGP ؔΛΤίʔαʔόʔ͔Β࣮ߦ͢Δ ɹ $ mruby/bin/mrbc
-Baddrinfo addrinfo.rb 3VCZιʔείʔυ͔Β$ؔΛ࡞͢Δ ໊ؔͱιʔεϑΝΠϧΛͯ͠NSCDίϚϯυΛ࣮ߦ
#include <mruby.h> #include “addrinfo.c” mrb_state *mrb = mrb_open(); // ͜͜ͰΔ͜ͱ
// ɹɾBEESJOGP ؔΛݺͼग़͢ // ɹɾ"EESJOGPΦϒδΣΫτ͔ΒΞυϨεใΛऔಘ͢Δ // ɾɹऔಘͨ͠ΞυϨεใͰιέοτΛ࡞͢Δ mrb_close(mrb); FDIPTFSWFSD BEESJOGPDΛಡΈࠐΉͱɺ BEESJOGP ͕ؔར༻Ͱ͖ΔΑ͏ʹͳΔ 3VCZιʔείʔυΛΤίʔαʔόʔʹΈࠐΉ
mrb_value addr = mrb_load_irep(mrb, addrinfo); mrb_value domain = mrb_funcall(mrb, addr,
"afamily", 0); mrb_value socktype = mrb_funcall(mrb, addr, "socktype", 0); mrb_value protocol = mrb_funcall(mrb, addr, "protocol", 0); mrb_value port = mrb_funcall(mrb, addr, "ip_port", 0); mrb_value address = mrb_funcall(mrb, addr, "ip_address", 0); BEESJOGP ؔΛݺͼग़͢ FDIPTFSWFSD BEESJOGP ؔΛ࣮ߦ͢Δͱ"EESJOGPΦϒδΣΫτ͕ฦͬͯ͘Δ
mrb_value addr = mrb_load_irep(mrb, addrinfo); mrb_value domain = mrb_funcall(mrb, addr,
"afamily", 0); mrb_value socktype = mrb_funcall(mrb, addr, "socktype", 0); mrb_value protocol = mrb_funcall(mrb, addr, "protocol", 0); mrb_value port = mrb_funcall(mrb, addr, "ip_port", 0); mrb_value address = mrb_funcall(mrb, addr, "ip_address", 0); "EESJOGPΦϒδΣΫτ͔ΒΞυϨεใΛऔಘ͢Δ ͜ͷ"EESJOGPΦϒδΣΫτ͔Β ιέοτͷ࡞ʹඞཁͳ֤छΞυϨεใΦϒδΣΫτΛऔಘ͢Δ FDIPTFSWFSD υϝΠϯ໊ ιέοτλΠϓ ϓϩτίϧ ϙʔτ൪߸ *1ΞυϨε
mrb_value addr = mrb_load_irep(mrb, addrinfo); mrb_value domain = mrb_funcall(mrb, addr,
"afamily", 0); mrb_value socktype = mrb_funcall(mrb, addr, "socktype", 0); mrb_value protocol = mrb_funcall(mrb, addr, "protocol", 0); mrb_value port = mrb_funcall(mrb, addr, "ip_port", 0); mrb_value address = mrb_funcall(mrb, addr, "ip_address", 0); ֤ΞυϨεใΦϒδΣΫτ͜ͷޙɺ ιέοτΛ࡞͢Δ$ؔͷҾͱͯ͠༻͞ΕΔ ͦͷࡍ3VCZΦϒδΣΫτ͔Β$ͷJOUܕʹม͓ͯ͘͠ඞཁ͕͋Δ FDIPTFSWFSD "EESJOGPΦϒδΣΫτ͔ΒΞυϨεใΛऔಘ͢Δ υϝΠϯ໊ ιέοτλΠϓ ϓϩτίϧ ϙʔτ൪߸ *1ΞυϨε
mrb_value addr = mrb_load_irep(mrb, addrinfo); mrb_value domain = mrb_funcall(mrb, addr,
"afamily", 0); mrb_value socktype = mrb_funcall(mrb, addr, "socktype", 0); mrb_value protocol = mrb_funcall(mrb, addr, "protocol", 0); mrb_value port = mrb_funcall(mrb, addr, "ip_port", 0); mrb_value address = mrb_funcall(mrb, addr, "ip_address", 0); FDIPTFSWFSD "EESJOGPΦϒδΣΫτ͔ΒΞυϨεใΛऔಘ͢Δ υϝΠϯ໊ ιέοτλΠϓ ϓϩτίϧ ϙʔτ൪߸ ͜͜·Ͱ*OUFHFSΦϒδΣΫτ *OUFHFSΦϒδΣΫτNSVCZͷ$"1*Λར༻͢Δ͜ͱͰ $ͷJOUܕม͢Δ͜ͱ͕Ͱ͖Δ
"EESJOGPΦϒδΣΫτ͔ΒΞυϨεใΛऔಘ͢Δ mrb_value addr = mrb_load_irep(mrb, addrinfo); mrb_value domain = mrb_funcall(mrb,
addr, "afamily", 0); mrb_value socktype = mrb_funcall(mrb, addr, "socktype", 0); mrb_value protocol = mrb_funcall(mrb, addr, "protocol", 0); mrb_value port = mrb_funcall(mrb, addr, "ip_port", 0); mrb_value address = mrb_funcall(mrb, addr, "ip_address", 0); FDIPTFSWFSD 4USJOHΦϒδΣΫτ$ͷJOUܕมͰ͖ͳ͍ FHlz *1ΞυϨε4USJOHΦϒδΣΫτ ͋Β͔͡Ί4USJOHΦϒδΣΫτ͔Β*OUFHFSΦϒδΣΫτม͢Δඞཁ͋Γ
*1ΞυϨε จࣈྻ Λ*1ΞυϨε ʹม͢Δ class Addr2Int RE_IPV4ADDRLIKE = %r{
\A (\d+) \. (\d+) \. (\d+) \. (\d+) \z }x def self.convert(addr) m = RE_IPV4ADDRLIKE.match(addr) octets = m.captures octets.inject(0) { |i, s| (n = s.to_i) < 256 s.match(/\A0./) i << 8 | n } end end BEESJOUSC ࢀߟIUUQTHJUIVCDPNSVCZJQBEESCMPCDDCFBECDDGEMJCJQBEESSC- *1ΞυϨεͷจࣈྻΛʹม͢Δ "EES*OUDPOWFSUϝιουΛ༻ҙ *1"EESFTTϥΠϒϥϦͷUP@Jϝιουͷ࣮Λ͓आΓͯ͠ʜ
"EES*OUDPOWFSUϝιουΛ࣮ͨ͠ιʔεϑΝΠϧΛ Τίʔαʔόʔ͔ΒಡΈࠐΉ NSVCZͷ$"1*Λར༻ͯ͠"EES*OUDPOWFSUϝιουΛݺͼग़͢ Τίʔαʔόʔ $ BEESJOUSC "EES*OUDPOWFSU Τίʔαʔόʔ͔Β"EES*OUDPOWFSUϝιουΛݺͼग़͢ "EES*OUDPOWFSU
"EESJOGPΦϒδΣΫτ͔ΒΞυϨεใΛऔಘ͢Δ mrb_value addr = mrb_load_irep(mrb, addrinfo); // … mrb_value address
= mrb_funcall(mrb, addr, "ip_address", 0); FILE *addr2int_src = fopen("addr2int.rb", "r"); mrb_load_ fi le(mrb, addr2int_src); fclose(addr2int_src); mrb_value addr2int_klass = mrb_obj_value(mrb_class_get(mrb, "Addr2Int")); mrb_value inaddr = mrb_funcall(mrb, addr2int_klass, "convert", 1, address); FDIPTFSWFSD BEESJOUSCιʔεϑΝΠϧΛ ಡΈࠐΉ "EES*OUDPOWFSUϝιουʹ*1ΞυϨε จࣈྻ Λ࣮ͯ͠ߦ
"EESJOGPΦϒδΣΫτ͔ΒΞυϨεใΛऔಘ͢Δ mrb_value addr = mrb_load_irep(mrb, addrinfo); // … mrb_value address
= mrb_funcall(mrb, addr, "ip_address", 0); FILE *addr2int_src = fopen("addr2int.rb", "r"); mrb_load_ fi le(mrb, addr2int_src); fclose(addr2int_src); mrb_value addr2int_klass = mrb_obj_value(mrb_class_get(mrb, "Addr2Int")); mrb_value inaddr = mrb_funcall(mrb, addr2int_klass, "convert", 1, address); FDIPTFSWFSD ➡︎ *1ΞυϨεΛද͢*OUFHFSΦϒδΣΫτ͕ฦͬͯ͘Δ BEESJOUSCιʔεϑΝΠϧΛ ಡΈࠐΉ "EES*OUDPOWFSUϝιουʹ*1ΞυϨε จࣈྻ Λ࣮ͯ͠ߦ
struct sockaddr_in saddr; saddr.sin_family = mrb_integer(domain); saddr.sin_addr.s_addr = htonl(mrb_integer(inaddr)); saddr.sin_port
= htons(mrb_integer(port)); int listener; if ((listener = socket(mrb_integer(domain), mrb_integer(socktype), mrb_integer(protocol))) < 0) { perror("socket(2)"); exit(1); } // … औಘͨ͠ΞυϨεใͰιέοτΛ࡞͢Δ FDIPTFSWFSD ΞυϨεใͷ*OUFHFSΦϒδΣΫτΛ$ͷJOUܕʹม͠ɺ ιέοτΛ࡞ ҎԼɺͦͷଞͷॲཧΛ࣮ ม ιέοτ࡞ ม ม ม ม ม
αʔόʔ NSVCZͷMJCNSVCZBϑΝΠϧͱϦϯΫͯ͠ΤίʔαʔόʔΛίϯύΠϧ ΤίʔαʔόʔΛىಈ͢Δ
αʔόʔ ΫϥΠΞϯτ NSVCZͷMJCNSVCZBϑΝΠϧͱϦϯΫͯ͠ΤίʔαʔόʔΛίϯύΠϧ ΤίʔαʔόʔΛىಈ͢Δ ΫϥΠΞϯτ͔ΒαʔόʔϝοηʔδΛૹ৴͢Δ
αʔόʔ αʔόʔ ΫϥΠΞϯτ NSVCZͷMJCNSVCZBϑΝΠϧͱϦϯΫͯ͠ΤίʔαʔόʔΛίϯύΠϧ ΤίʔαʔόʔΛىಈ͢Δ ΫϥΠΞϯτ͔ΒαʔόʔϝοηʔδΛૹ৴͢Δ αʔόʔϝοηʔδΛड͚औΓɺͦͷ··ΫϥΠΞϯτฦ৴͢Δ
αʔόʔ αʔόʔ ΫϥΠΞϯτ NSVCZͷMJCNSVCZBϑΝΠϧͱϦϯΫͯ͠ΤίʔαʔόʔΛίϯύΠϧ ΤίʔαʔόʔΛىಈ͢Δ ΫϥΠΞϯτ͔ΒαʔόʔϝοηʔδΛૹ৴͢Δ αʔόʔϝοηʔδΛड͚औΓɺͦͷ··ΫϥΠΞϯτฦ৴͢Δ ΫϥΠΞϯταʔόʔ͔Βͷฦ৴Λड͚औΔ
ࢀߟਤॻ 8FCͰ͑Δ NSVCZγεςϜϓϩάϥϛϯάೖ ஶऀɿۙ౻Ӊஐ࿕ IUUQTXXXDSDPNCPPLEFUBJM ೖNSVCZ $͔ΒNSVCZ"1*Λ͍͜ͳ͢ ஶऀ:BNBOFLLP IUUQTCPPUIQNKBJUFNT
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ ḉ
None
None
None
None