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
250
Introduction of Happy Eyeballs Version 2 (RFC8305) to the Socket library
coe401_
1
340
An adventure of Happy Eyeballs
coe401_
3
9.7k
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
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
N.E.X.T LEVEL
pluu
2
300
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
fs2-io を試してたらバグを見つけて直した話
chencmd
0
220
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Italy
prof18
0
150
命名をリントする
chiroruxx
1
380
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
Haze - Real time background blurring
chrisbanes
1
500
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
350
Jakarta EE meets AI
ivargrimstad
0
230
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
169
14k
Practical Orchestrator
shlominoach
186
10k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Building Adaptive Systems
keathley
38
2.3k
Writing Fast Ruby
sferik
628
61k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Designing for humans not robots
tammielis
250
25k
Agile that works and the tools we love
rasmusluckow
328
21k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
The Cult of Friendly URLs
andyhume
78
6.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
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