TCP Server Program

Date: 05-Feb-1998
(c) Copyright 1997, 1998 by H.Fujii

$B%5!<%P%W%m%0%i%`$O!"0lHL$K!"J#?t$N%/%i%$%"%s%H$+$i$NMW5a$r(B $B=hM}$9$k$3$H$,5a$a$i$l$^$9!#(BUNIX$B$J$I$G$O!"(Bfork()$B$r;H$C$F(B $B$3$N=hM}$r9T$&$N$,IaDL$G$9$,!"(BWIN32$B$K$O(B fork() $B$^$?$O!"(B $BD>@\$=$l$KAjEv$9$k$b$N$O$"$j$^$;$s!#$=$3$G!"Be$o$j$NJ}K!$,(B $BI,MW$K$J$j$^$9$,!"$3$3$G$O(B thread $B$r;H$&>l9g$r9M$($^$9!#(B

$B%W%m%0%i%`$N9|;R(B
$B%W%m%0%i%`$N9|3JItJ,$O!"(B$BJ88%#1(B$B$K<($7$F(B $B$"$kNcBj$r4pAC$K$7$^$9!#$^$:$d$k$Y$-9|;R$r@0M}$7$^$7$g$&!#(B $B$d$k$Y$-$3$H$O!"

  • $B@\B3uBV$KCV$/!#(B
  • $B$B$BCLG$9$k!#(B
  • $B%a%$%s$N(B thread $B$G$O!"

    $B>e$N9|;R$G!"LdBj$K$J$k$N$O(B thread $B$N5/F0@8@.$H!"=*N;$G$9!#(BPOSIX $B$G(B $B$"$l$P!"(Bpthread_create() $B$KAjEv$9$k$b$N$,(B WIN32 $B$G$O2?$+!)$^$?(B POSIX $B$G$"$l$P!"(Bthread $B4X?t$+$i(B return $B$9$k$H!"$=$N(B thread $B$O>CLG(B $B$7$^$9$,!"(BWIN32 $B$G$bF1$8$3$H$,8@$($k$+!)$3$N(B 2 $BE@$r$^$:2!$5$($kI,MW$,(B $B$"$j$^$9!#(B

    WIN32 $B$G$N(B Thread
    WIN32 $B$N%^%K%e%"%k!J(BWIN32 SDK Online Help)$B$r8+$k$H!"(BThread $B$N@8@.$K(B $B$H=*N;$N$?$a$N$$$/$D$+$N4X?t$,$"$j$^$9!#(B

    $B$3$N$&$A!":G=i$NFs$D$O!"(Bthread $B4X?t$,(B C $B$N%i%s%?%$%`%i%$%V%i%j!<$r(B $B;HMQ$9$k>l9g$H$J$C$F$$$^$9!#$^$?!"(B_beginthread() $B$H(B _beginthreadex() $B$H$NBg$-$J0c$$$O!"8euBV$N;XDj!J@8@.8e!"(B $BD>$A$KuBV$KCV$$$F$*$/$+$N;XDj!K$,$G$-$k$3$H$N$h$&(B $B$G$9!#(B

    $B$3$N5-;vL$40(B

    $B;29MJ88%(B

    • [1] Comer, Douglas E., "Internetworking with TCP/IP", Vol.I, 2nd. Ed., Section 21.27 pp.359-362, Prentice-Hall (1991), ISBN 0-13-468505-9.