반응형

NetworkProgramming 20

TCP Note #2 Gracefully Close(..)

From Chapter 6 내부구조, TCP/IP The Pocket Guide to TCP/IP Sockets C, MSDN closesocket function[winsock], 'Graceful Shutdown, Linger Options, and Socket Closure', NetworkProgramming For Microsoft Windows What? Gracefully Close란 TCP에서 4way-handshake를 정상으로 마친 그러니까 서로 FIN, ACK를 주고 받고 연결이 종료된 상태이다. Why Important? 이 Gracefully Close를 통하여 소켓의 close(..)를 호출한 쪽은 자신이 보내고자 하는 데이터가 정상적으로 상대편에 다 도착했음을 보장받는다. 이는..

TCP & UDP Note #1

From Chapter 6 내부구조, TCP/IP The Pocket Guide to TCP/IP Sockets C, MSDN, NetworkProgramming For Microsoft Windows Socket 소켓구조체 1) 내부의 소켓구조와 링크된 일종의 핸들(Handle) 2) 지역 및 원격 인터넷 주소와 포트, SendQueue, RecvQueue, TCP연결관련상태정보 TCP 1. Defensive Programming 1) Deadlock n bytes를 send(...)할 때, n=source SendQ size + destination RecvQ size + remained size n>source SendQ size + destination RecvQ size 클 경우 보낸 호스트는 ..

UDP, recvfrom()에서 WSAECONNRESET(10054) 에러 날 때...

recvfrom(...)에서 WSAECONNRESET(10054)에러가 나오면, 열라 황당하죠... 왜냐하면 10054의 의미는 ICMP Port Unreachable이라는 것인데, recvfrom은 내 소켓에서 데이터를 받는 것이니 왠? Unreachable? UDP에서 WSAECONNREST? WSAECONNRESET은 해당코드가 TCP에서의 에러일 떄의 의미를 이야기 하는 것이고 UDP소켓에서의 이유는 아래와 같이 MSDN에서 나와 있습니다. " On a UDP-datagram socket this error indicates a previous send operation resulted in an ICMP Port Unreachable message. " 뭐, 간단히 해석하자면 "먼저번 Send(..

TCP/IP에 대한 유용한 글 모음

TCP Segment: http://en.wikipedia.org/wiki/TCP_segment, http://www.linktionary.com/s/segment_tcp.html 자칫 햇갈릴 수도 있는 TCP Segment에 대한 정의가 나와 있는 글들... TCP Sliding Window: http://forgarden.tistory.com/113 TCP 슬라이딩 윈도우에 대한 설명이 쉽게 나와 있는 글... TCP Window Size의 크기에 따른 영향: http://forgarden.tistory.com/114 TCP의 Window Size의 크기가 성능에 어떤 영향을 미치는지 나와 있습니다.

float, double network ordering, float, double 타입의 네트워크 순서(오더)에 관하여...

float 타입이나 double 타입의 전송은 네트워크 프로그래밍 관련하여 공부한 몇 권의 책에서 나오지 않는 내용이라 열시미 찾아 보았답니다. 우선 float 나 double 타입에 대해서 기본적인 지식을 알아보면 아래와 같이 인터넷에서 찾은 글이 참이나 설명을 잘해주고 있습니다. Floats and doubles tend (in modern chip architectures) to be represented using an IEEE-standard format; so the commonly defined types *are* "float" (single-precision) and "double" (double-precision). These have precise meanings in the stan..

반응형