Socket Interface

esmin·2021년 1월 21일
0

컴퓨터시스템 (CSAPP)책을 보면, Application을 '응용'이라고 번역해놓았다. 생소하지만, 읽다보니 적응이 되었다.

CSAPP Solution

https://dreamanddead.gitbooks.io/csapp-3e-solutions/content/chapter11/11.8.html

TCP almost always uses SOCK_STREAM and UDP uses SOCK_DGRAM.

CSAPP 11장 네트워크를 알기전에
10장 파일 입출력부터 공부해야 한다.
RIO라는 개념이 나온다.
자. 다시 RIO에서, Buffered Input과 Unbuffered Input이 뭔지 알아보자.

rio 관련 함수를 잘 정리해놓은 블로그
https://2pound2pound.tistory.com/238
잘 정리해놓은 깃허브
https://gist.github.com/JoonSoo-Park/2801e5e0fee5bc8ccd581c91fe85755d

Buffered Input은 input을 받고 잠시 저장해둔다. 바람직한 방법으로 다시 사용될 때 까지..
Rio_readintib 와 같이 끝에 b가 붙으면 buffer라고 생각면 좋을 듯 하다.

https://www.oreilly.com/library/view/mastering-go/9781788626545/7bd7b60c-3d18-4b56-ba16-126e836b6a03.xhtml#:~:text=Buffered%20file%20input%20and%20output,reading%20data%20or%20writing%20data.&text=Unbuffered%20file%20input%20and%20output%20happens%20when%20there%20is%20no,actually%20reading%20or%20writing%20it.

Buffered and unbuffered file input and output
Buffered file input and output happens when there is a buffer for temporarily storing data before reading data or writing data. Thus, instead of reading a file byte by byte, you read many bytes at once. You put it in a buffer and wait for someone to read it in the desired way. Unbuffered file input and output happens when there is no buffer to temporarily store data before actually reading or writing it.

The next question that you might ask is how to decide when to use buffered and when to use unbuffered file input and output. When dealing with critical data, unbuffered file input and output is generally a better choice because buffered reads might result in out-of-date data and buffered writes ...

버퍼란 무엇인가..


Socket Interface

모든 정보가 다 담겨있는 듯 한 최고의 사이트..https://beej.us/guide/bgnet/html/#acceptthank-you-for-calling-port-3490


Short Count: 짧은 카운트

일부 경우에 응용이 요청한대로 return 해주는 것이 아니라 그보다 짧게 리턴해준다. -> 네트워크 프로그램 같은 응용에서 Short Count가 많이 발생한다. 이에따라 RIO를 만들어두면 네트워크 통신하기 용이하다.
자동으로 짧은카운트를 처리해주는 RIO(Robust I/O) 만들기.


https://www.youtube.com/watch?v=xs9sGhBP6-E&ab_channel=JeonghunCho


바이트 오더링 해결하는 인터페이스

Multi client

자식을 만들어 자식이 대신 처리하도록 한다
요즘은 Thread를 만들어서 대신 처리하게 함
예전에는 Process를 만들어서 대신 처리하게 함

0개의 댓글