![]() |
![]()
| ![]() |
![]()
̾??ttcp —
?ȥ??ߥå??????ȥ??????ץ??ȥ????Υȥ???????????ĥ??ǽ
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
int
setsockopt (sock,
IPPROTO_TCP, TCP_NOPUSH,
&One, sizeof One)
ssize_t sendto (sock,
msg, len,
MSG_EOF, &sin,
sizeof sin)
ssize_t sendto (sock,
msg, len,
MSG_EOF, 0,
0)????T/TCP ?? TCP ?ץ??ȥ??? ( tcp(4) ??) ?ؤγ?ĥ??ǽ?ν????Ǥ??? ?ܵ?ǽ?ˤ??꾯?̤Υǡ????? 2 ?ĤΥѥ??åȤθǤ????Ȥꤹ?뤳?Ȥ??Ǥ??? ???ä?ɸ???? TCP ???ͥ?????????????ȯ??????;ʬ?ʱ????ˤ????ٱ???̵???????Ȥ??Ǥ??ޤ??? ?????åȥ??ե??????? T/TCP ?ݡ??Ȥ????褦?˽????????Ƥ??ꡢ ?ޤ??????Ǥ????Τʥ??????ˤĤ??ƾܽҤ??Ƥ??ޤ??? ?ץ??ȥ????˰?¸???ʤ???ʬ?Υ??ݡ??ȤˤĤ??Ƥ? socket(2) ?ڤ? send(2) ?Υޥ˥奢???ڡ????ǽҤ٤????Ƥ??ޤ??? T/TCP ?? RFC 1644 ???????????Ƥ??ޤ???T/TCP
?????Υ??ͥ????????????????????Ȥˤ????ơ????륪?ץ???????
?????Ĥ??ޤ??뤳?Ȥˤ??ꡢT/TCP
??ĥ?ϵ?ǽ???ޤ???
?????ˤ??????ȤΥۥ??ȴ֤Ǥκǽ?????³?????????Ƥ?
3
???????ϥ??ɥ?????????̵???????Ȥ??Ǥ??ޤ???
??????Ʊ?????ץ????????Ѥ??ơ?
?Ť???ʣ?????ѥ??åȤ??????μ¤?Ƚ?̤??뤳?Ȥ???ǽ?Ǥ??ꡢ
???ä? TCP
?ץ??ȥ??뤬??³???Ĥ????塢???֤??ݤ??ʤ????Фʤ??ʤ?
???֤餹???Ȥ??Ǥ??ޤ???
“ ?ȥ????????????ǥ?T/TCP ???Ѥ??????? “?ȥ?????????” ?Υ??ǥ??Ϥ??ʤ?ñ???ʤ??ΤǤ?:
???饤?????ȥ??ݡ??????饤??????¦?Υ??ݡ??Ȥϡ? “???ۤ???³” ?ڤ? “?????ȥ????åȥ?????” ?γ?ǰ???????ͤ? sendto(2) ?ڤ? sendmsg(2) ?????ƥॳ?????ΰ?̣????ĥ???뤳?Ȥˤ????????ޤ??? ?ȥ??????????ˤ????????????????ˤ? sendto(2) ?????ƥॳ???????̾????Ѥ????????????ͤˤ??ޤ?:char request[REQ_LEN]; struct sockaddr_in sin; int sock, req_len; sock = socket(PF_INET, SOCK_STREAM, 0); /* request[] ?? sin ?ν??? */ err = sendto(sock, request, req_len, MSG_EOF, (struct sockaddr *)&sin, sin.sin_len); /* ???顼???? */ req_len = read(sock, request, sizeof request); close(sock); /* ???????? */
?????Х??ݡ???T/TCP ?????Ѥ????ݤ˥????Ф????Ѳ?ǽ?ʥ??ץ??????? 2 ?Ĥ????ޤ?:
??¸?Υ????Ф? T/TCP
??ĥ??ǽ?????Ѥ????褦???ѹ????Ԥ??ݤˤϡ?
?ǽ??Υ??ץ????????Ѥ????Τϰ???Ū?????????????Ǥ???
ñ???? 2
???ܤΥ??ץ??????ϡ????????????ФˤϤ???˾?ޤ??????ΤǤ???
?????ˤ??äƤϡ??Ť??????Фˤ?Ŭ?ѤǤ??뤯?餤??ñ?Ǥ???
???ξ??硢?????ʳ????̾?
sendto(sock, buf, len, MSG_EOF,
(struct sockaddr *)0, 0) ???ξ??硢??????ľ?????????????ޤ????????饤?????Ȥξ?????Ʊ?ͤˡ? ?????åȤϤ??λ????Dz??ˤ????Ѥ??뤳?ȤϽ????ޤ????? ľ???˥??????????٤??Ǥ??? MIB ???ѿ?T/TCP ??ĥ??ǽ?????Ѥ????ˤϡ? Ŭ?ڤ? TCP ???ץ????????????????褦?? MIB ?ѿ? “net.inet.tcp.rfc1644 ”
?????Ǥ??뤳?Ȥ?ɬ?פȤ??ޤ???
?ܺ٤?
tcp(4)
?Ȥ??Ʋ???????
??Ϣ????send(2), setsockopt(2), inet(4), tcp(4) R. Braden, T/TCP - TCP Extensions for Transactions, RFC 1644.????T/TCP ?Υ??ݡ??Ȥ? FreeBSD 2.1 ?ǽ????ƹԤ????ޤ????? ?????? The University of Southern California ?? Information Sciences Institute ?? Bob Braden ?? Liming Wei ?????????ɤ????ˤ??Ƥ??ꡢ The University of Twente ?? Andras Olah ???ܿ????ޤ?????
|