C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[52431] Re:GetNextRequest에 대해서 아시는분 설명 부탁드립니다..^^;;
아루스 [tinydew4] 1091 읽음    2008-02-26 11:41
코드의 앞 뒤 전후를 살펴보건데
GetNextRequest 라고 Buffer 에 처리할 메세지를 받아오는 함수를
thread-safe 하게 작성하라는 거 같은데요...

역삼골 님이 쓰신 글 :
: TWinSocketStream Write() Method 셈플예제에 보면
: GetNextRequest() <- GetNextRequest must be a thread-safe method
: 라는 부분이 있는데요.
: C Builder에서는 없는 함수네요.
: 설명 좀 부탁드립니다.
:
: 메모리증가하는것 때문에 검색하고 있는데요.
: 잘 안되네요.
: 저만 그런가요..--;;
:
: 아래 소소는 C Builder 도움말에서 가져왔습니다.
:
:
:
: This example shows the execute method of a thread used to send requests to a server over a socket connection:
:
: void __fastcall TMyClientThread::Execute()
: {
:   // create a TWinSocketStream for reading and writing
:   TWinSocketStream *pStream = new TWinSocketStream(ClientSocket1->Socket, 60000);
:   try
:   {
:     // fetch and process commands until the connection or thread is terminated
:     while (!Terminated && ClientSocket1->Active)
:     {
:       try
:       {
:         char buffer[10];
:         GetNextRequest(buffer); // GetNextRequest must be a thread-safe method
:
:         // write the request to the server
:         pStream->Write(buffer, strlen(buffer) + 1);
:         // continue the communication (eg read a response from the server)
:         ...
:       }
:       catch (Exception &E)
:       {
:         if (!E.ClassNameIs("EAbort"))
:           Synchronize(HandleThreadException()); // you must write HandleThreadException
:       }
:     }
:   }
:   __finally
:   {
:     delete pStream;
:   }
: }

+ -

관련 글 리스트
52427 GetNextRequest에 대해서 아시는분 설명 부탁드립니다..^^;; 역삼골 1128 2008/02/26
52431     Re:GetNextRequest에 대해서 아시는분 설명 부탁드립니다..^^;; 아루스 1091 2008/02/26
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.