서버프로그래밍2019. 7. 25. 19:35

ERROR_SEM_TIMEOUT

121 (0x79)

The semaphore timeout period has expired.

 

내가 끊은적도 없고 클라도 아니고 통신량이 많아서 강제적으로 끊어짐.

그렇다고 내 잘못이 아니라고 하기 힘들다.

네트워크 전송량은 늘어나는데 메시지 TPS는 떨어짐.

일정시간 지속되면 끊어지는 녀석들이 생길수있음.

관련 현상은 모니터링쪽 코드 추가해서 관리가 필요함.

 

'서버프로그래밍' 카테고리의 다른 글

listenSocket SOMAXCONN_HINT(N)  (0) 2019.07.25
서버 프로그래밍 관련 질문글 (GPGStudy)  (0) 2019.07.08
Linger와 Time_wait  (0) 2019.06.04
Graceful Shutdown  (0) 2019.06.04
디피 헬만 키 교환  (0) 2019.05.21
Posted by 멜데스
서버프로그래밍2019. 7. 25. 18:24

listen function

  • 12/05/2018
  • 5 minutes to read

The listen function places a socket in a state in which it is listening for an incoming connection.

Syntax

C++Copy

int WSAAPI listen( SOCKET s, int backlog );

Parameters

s

A descriptor identifying a bound, unconnected socket.

backlog

The maximum length of the queue of pending connections. If set to SOMAXCONN, the underlying service provider responsible for socket s will set the backlog to a maximum reasonable value. If set to SOMAXCONN_HINT(N) (where N is a number), the backlog value will be N, adjusted to be within the range (200, 65535). Note that SOMAXCONN_HINT can be used to set the backlog to a larger value than possible with SOMAXCONN.

SOMAXCONN_HINT is only supported by the Microsoft TCP/IP service provider. There is no standard provision to obtain the actual backlog value.

SOMAXCONN_HINT(N)라는 매크로가 하나가 더 있다. 큐 조절 가능

'서버프로그래밍' 카테고리의 다른 글

세마포어 타임아웃  (0) 2019.07.25
서버 프로그래밍 관련 질문글 (GPGStudy)  (0) 2019.07.08
Linger와 Time_wait  (0) 2019.06.04
Graceful Shutdown  (0) 2019.06.04
디피 헬만 키 교환  (0) 2019.05.21
Posted by 멜데스
서버프로그래밍2019. 7. 8. 22:04

http://foroum.gpgstudy.com/forum/viewtopic.php?t=12603

 

서버가 여러대일 경우 - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 비회원 전체글 글쓴이: 비회원 » 2006-09-20 15:16 수정된 게임 서버를 여러대의 컴퓨터에 옮길때 어떻게 옮기시나요? 만약 서버가 20대라면 일일이 복사하진 않을꺼 같은데요 .... 쉽게 할수 있는 방법이라도....? 비회원 전체글 글쓴이: 비회원 » 2006-09-20 15:21 비회원 작성:수정된 게임 서버를 여러대의 컴퓨터에 옮길때 어떻게

foroum.gpgstudy.com

https://www.gpgstudy.com/forum/viewtopic.php?t=20093

 

게임 서버 개발에 SQL은 독이다?? - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 imays 전체글: 1044 가입일: 2003-02-18 10:29 연락처: 전체글 글쓴이: imays » 2008-06-22 23:00 GDC08에서 발표된 내용이기도 합니다. http://t-machine.org/index.php/2008/02/ ... d-harmful/ 대충만 읽어봤습니다. 요약하자면... - SQL는 범용적 목적의 서버다. - SQ

www.gpgstudy.com

https://gpgstudy.com/forum/viewtopic.php?t=3356#p12227

 

서버에서 클라이언트로 패킷을 보낼 때의 적정 크기는 얼마나 될 - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 jacking 전체글: 1035 가입일: 2002-01-09 09:00 전체글 글쓴이: jacking » 2004-05-07 10:16 제가 알기로 일정이상의 크기를 넘어서는 패킷을 서버에서 클라이언트로 보내면 패킷이 자동으로 잘라져서 보내는데 가능하면 패킷이 잘라지지는 않는 범위만큼만 보내어 TCP/IP가 아닌 프로그램에서 패킷량을 조절해서 보내면 좋다고

gpgstudy.com

https://gpgstudy.com/forum/viewtopic.php?t=15420

 

NPC 서버와 클라이언트 - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 심 형근 전체글: 526 가입일: 2002-08-19 23:30 전체글 글쓴이: 심 형근 » 2007-04-04 11:54 프로그래머가 아닌 게이머일때부터 많이 궁금했었던 부분인데, 프로그래머가 되어서도 아직도 의구심이 해결되지 않아서, 글을 남깁니다. 리니지2 에서 플핏을 키울때, "NPC 서버가 정상화 되었습니다." 라는 글이 뜨고나서, 게이트키퍼,상점

gpgstudy.com

https://gpgstudy.com/forum/viewtopic.php?t=6697

 

한 머신에서 이론적으로 수용할수 있는 클라이언트의 한계가 - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 비회원 전체글 글쓴이: 비회원 » 2005-07-29 10:33 있는지 알고 싶습니다. 예를 들어 채팅서버를 만들었다 했을시... 한 채팅서버에 수용인원을 10만명으로 해도 되냐는거죠... 하드웨어적으로 가능한지 알고 싶습니다. 노파심에 얘기 하는데요....... 서버당 접속 인원이 많아지만 게임하는데 지장이 있다 이런걸 듣자는게 아니라 윈도우 환경의 서버

gpgstudy.com

http://w.gpgstudy.com/forum/viewtopic.php?t=7642

 

서버와 채널의 차이점이 궁금합니다. - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 비회원 전체글 글쓴이: 비회원 » 2005-10-14 13:13 오늘도 좋은하루 되시길 바라며 여러분들의 도움의 손길을 받기위해 질문글 하나 조심스래 올려봅니다. ^^; 바로 질문을 적어보자면.. 제목에도 있듯이 서버와 채널의 차이점 이랍니다. 채널은 무엇이며 무슨 이유로 두는 것인가요? 서버 안에서 유져를 효율적으로 관리하기 위해 둔 개념인가요? 하나의

w.gpgstudy.com

http://foroum.gpgstudy.com/forum/viewtopic.php?t=3457

 

심리스 월드, 과연? - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 kaswan 전체글 글쓴이: kaswan » 2004-05-26 23:05 현실을 복제한 세계를 만들어야 하는 시물레이션이 아닌 한 게임 세계가 이음매 없는 연속적인 세계여야 할 필요가 없다고 봅니다. 가상은 어디까지나 가상입니다. 진짜가 아니므로 얼마든지 현실의 제약이나 규칙을 무시하거나 어길 수 있습니다. 리쳐드 게리옷도 울티마 온라인 시절의 온라인 게

foroum.gpgstudy.com

https://www.gpgstudy.com/forum/viewtopic.php?f=18&t=23484

 

iocp를 이용한 게임 서버 구현시 wsasend 응용 버퍼 처리 문제 - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 비회원 전체글 글쓴이: 비회원 » 2009-06-11 17:43 게임 서버상에서 보통 유저의 인접한 유저들에게 정보를 같이 정보를 전송을 하게 되는데, 마을 같은 경우는 수백명이 있을수가 있다고 가정을 해서 부하테스트를 진행 중인데, 한명이 움직이면 주변 수백명에게 정보를 전송하는 루틴을 만들었습니다. 물론 한명이 움직이는게 아니라 수백명 모두 움직이는 루

www.gpgstudy.com

http://foroum.gpgstudy.com/forum/viewtopic.php?t=4380

 

온라인 게임 서버에서 3차원 공간분할에 대한 의견... - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 비회원 전체글 글쓴이: 비회원 » 2004-10-29 10:11 안녕하세요. 전 경력4년차의 서버 프로그래머입니다. 여기서는 처음 글을 남기네요~ ^^ 현재 우리나라에서 개발된 게임이나 개발중인 게임들을 보면, 서버상에서 완벽한 3차원 공간을 제공하는 경우가 없는거같더군요. (외국의 사례는 스타워즈 겔럭시... ) 리니지2도 겉으로 보면 3차원같지만, 자세

foroum.gpgstudy.com

https://www.gpgstudy.com/forum/viewtopic.php?t=18249

 

대규모 서버 구성에 대해서 질문드립니다. - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 todream 전체글: 7 가입일: 2007-12-21 17:28 전체글 글쓴이: todream » 2007-12-21 17:31 안녕하세요. 게임서버에도 어느정도 적용될거 같은 질문인데요.. 현재 대용량 메신저 서버를 제작중인데.. 서버구성을 함에 있어 궁금한게 있어 질문드립니다. 예전에 스트리밍 서버를 제작하면서 각각 로긴서버, 세션서버, 스트림서버 이

www.gpgstudy.com

https://www.gpgstudy.com/forum/viewtopic.php?t=24446

 

서버에서 npc의 구현 - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 비회원 전체글 글쓴이: 비회원 » 2009-09-27 01:59 서버 프로그래밍을 지망하는 지망생입니다. 서버를 다룬지도 얼마안됐고, 게임 서버프로그래밍을 하는건 이번이 처음입니다. 생각해보다가, 보통 게임 서버에서는 어떤식으로 처리하는지 몰라 이렇게 질문 드립니다. 서버에서 npc의 움직임을 보내주는걸로 알고있습니다. 그럼 이 npc의 움직임을 어떤형식으

www.gpgstudy.com

https://gpgstudy.com/forum/viewtopic.php?t=19446

 

AI서버와 게임서버의 역할을 어떻게 정해줘야하죠? ㅜㅡ - GpgStudy 포럼

3권에서 새로 도입된 네트웍 및 멀티플레이어 프로그로그래밍 섹션을 위한 게시판입니다. 운영자: 류광 비회원 전체글 글쓴이: 비회원 » 2008-04-11 18:48 지금 게임 서버를 만들고 있는 초짜 개발자입니다.. 게임을 처음부터 만들어보는건 처음이구요.. 근데 보통 게임에서 AI서버와 게임서버가 어떤 역할을 하는지 잘 모르겠습니다. 지금 제가 생각한대로 만들고는 있는데 이건 아니다 싶은 생각이 문득 드는군요.. 제가 생각한것은요.... AI서버는 길찾

gpgstudy.com

 

'서버프로그래밍' 카테고리의 다른 글

세마포어 타임아웃  (0) 2019.07.25
listenSocket SOMAXCONN_HINT(N)  (0) 2019.07.25
Linger와 Time_wait  (0) 2019.06.04
Graceful Shutdown  (0) 2019.06.04
디피 헬만 키 교환  (0) 2019.05.21
Posted by 멜데스
서버프로그래밍2019. 6. 4. 19:52

4-way-handshake 진입 시 

의외로 FIN_WAIT_1이나 TIME_WAIT가 너무 많이 남는다.

특히 IOCP때 잘못 설계시 종료에 대한 응답이 오지 않는 상태로 남는다.

일정시간 지나면 없어지긴한다. 다만 일시적으로 많이 생기면 불안요소로 남게된다.

링거 걸고 클로즈 소켓 유도(Time_out)해서 RST로 파괴

'서버프로그래밍' 카테고리의 다른 글

listenSocket SOMAXCONN_HINT(N)  (0) 2019.07.25
서버 프로그래밍 관련 질문글 (GPGStudy)  (0) 2019.07.08
Graceful Shutdown  (0) 2019.06.04
디피 헬만 키 교환  (0) 2019.05.21
밀러 라빈 소수 판별법  (0) 2019.05.21
Posted by 멜데스
서버프로그래밍2019. 6. 4. 19:48

Graceful Shutdown, Linger Options, and Socket Closure

The following material is provided as clarification for the subject of shutting down socket connections closing the sockets. It is important to distinguish the difference between shutting down a socket connection and closing a socket.

Shutting down a socket connection involves an exchange of protocol messages between the two endpoints, hereafter referred to as a shutdown sequence. Two general classes of shutdown sequences are defined: graceful and abortive (also called hard). In a graceful shutdown sequence, any data that has been queued, but not yet transmitted can be sent prior to the connection being closed. In an abortive shutdown, any unsent data is lost. The occurrence of a shutdown sequence (graceful or abortive) can also be used to provide an FD_CLOSE indication to the associated applications signifying that a shutdown is in progress.

Closing a socket, on the other hand, causes the socket handle to become deallocated so that the application can no longer reference or use the socket in any manner.

In Windows Sockets, both the shutdown function, and the WSASendDisconnect function can be used to initiate a shutdown sequence, while the closesocket function is used to deallocate socket handles and free up any associated resources. Some amount of confusion arises, however, from the fact that the closesocket function implicitly causes a shutdown sequence to occur if it has not already happened. In fact, it has become a rather common programming practice to rely on this feature and to use closesocket to both initiate the shutdown sequence and deallocate the socket handle.

To facilitate this usage, the sockets interface provides for controls by way of the socket option mechanism that allow the programmer to indicate whether the implicit shutdown sequence should be graceful or abortive, and also whether the closesocket function should linger (that is not complete immediately) to allow time for a graceful shutdown sequence to complete. These important distinctions and the ramifications of using closesocket in this manner are still not widely understood.

By establishing appropriate values for the socket options SO_LINGER and SO_DONTLINGER, the following types of behavior can be obtained with the closesocket function:

  • Abortive shutdown sequence, immediate return from closesocket.
  • Graceful shutdown, delaying return until either shutdown sequence completes or a specified time interval elapses. If the time interval expires before the graceful shutdown sequence completes, an abortive shutdown sequence occurs, and closesocketreturns.
  • Graceful shutdown, immediate return—allowing the shutdown sequence to complete in the background. Although this is the default behavior, the application has no way of knowing when (or whether) the graceful shutdown sequence actually completes.

The use of the SO_LINGER and SO_DONTLINGER socket options and the associated linger structure is discussed in more detail in the reference sections on SOL_SOCKET Socket Options and the linger structure.

One technique that can be used to minimize the chance of problems occurring during connection teardown is to avoid relying on an implicit shutdown being initiated by closesocket. Instead, use one of the two explicit shutdown functions, shutdown or WSASendDisconnect. This in turn causes an FD_CLOSE indication to be received by the peer application indicating that all pending data has been received. To illustrate this, the following table shows the functions that would be invoked by the client and server components of an application, where the client is responsible for initiating a graceful shutdown.

일반적인 4way handshake가 아닌 반절 끊기

(1) Invokes shutdown(s, SD_SEND) to signal end of session and that client has no more data to send. (Client Side)
(2) Receives FD_CLOSE, indicating graceful shutdown in progress and that all data has been received. (Server Side)
(3) Sends any remaining response data. (Server Side)
(local timing significance only) Gets FD_READ and calls recv to get any response data sent by server . (Client Side) (4) Invokes shutdown(s, SD_SEND) to indicate server has no more data to send. (Server Side)
(5) Receives FD_CLOSE indication. (Client Side) (local timing significance only) Invokes closesocket . (Server Side)
(6) Invokes closesocket. (Client Side)

어디다 사용할까

오버랩IO때 새 소켓 생성을 만들지 않게 연결만 끊고 재활용할때 Shutdown

'서버프로그래밍' 카테고리의 다른 글

서버 프로그래밍 관련 질문글 (GPGStudy)  (0) 2019.07.08
Linger와 Time_wait  (0) 2019.06.04
디피 헬만 키 교환  (0) 2019.05.21
밀러 라빈 소수 판별법  (0) 2019.05.21
False Sharing - 캐시미스 이슈  (0) 2019.05.14
Posted by 멜데스
서버프로그래밍2019. 5. 21. 18:53

.

'서버프로그래밍' 카테고리의 다른 글

Linger와 Time_wait  (0) 2019.06.04
Graceful Shutdown  (0) 2019.06.04
밀러 라빈 소수 판별법  (0) 2019.05.21
False Sharing - 캐시미스 이슈  (0) 2019.05.14
cmd 명령어  (0) 2019.05.07
Posted by 멜데스
서버프로그래밍2019. 5. 21. 18:53

.

'서버프로그래밍' 카테고리의 다른 글

Graceful Shutdown  (0) 2019.06.04
디피 헬만 키 교환  (0) 2019.05.21
False Sharing - 캐시미스 이슈  (0) 2019.05.14
cmd 명령어  (0) 2019.05.07
간단한 서버 낙서  (0) 2019.05.07
Posted by 멜데스
서버프로그래밍2019. 5. 14. 19:47

.// 나중에

'서버프로그래밍' 카테고리의 다른 글

디피 헬만 키 교환  (0) 2019.05.21
밀러 라빈 소수 판별법  (0) 2019.05.21
cmd 명령어  (0) 2019.05.07
간단한 서버 낙서  (0) 2019.05.07
OSILayer 7계층  (0) 2019.05.07
Posted by 멜데스
서버프로그래밍2019. 5. 7. 20:06

ARP PINRT

netsh interface ipv4 show subinterfaces : MTU 체zm 

'서버프로그래밍' 카테고리의 다른 글

밀러 라빈 소수 판별법  (0) 2019.05.21
False Sharing - 캐시미스 이슈  (0) 2019.05.14
간단한 서버 낙서  (0) 2019.05.07
OSILayer 7계층  (0) 2019.05.07
분산  (0) 2019.05.07
Posted by 멜데스
서버프로그래밍2019. 5. 7. 20:05

APP계층 abc입력 send 호출

TCP계층 TCP헤더에는 포트가 주력 TCP헤더 = [TCP][abc] src:42000 dest:10000
0->50받으면 다시 51(ACK:회신) 보냄

'서버프로그래밍' 카테고리의 다른 글

False Sharing - 캐시미스 이슈  (0) 2019.05.14
cmd 명령어  (0) 2019.05.07
OSILayer 7계층  (0) 2019.05.07
분산  (0) 2019.05.07
도메인  (0) 2019.05.07
Posted by 멜데스