|
이현진 님이 쓰신 글 :
: 혀비.오기 님이 쓰신 글 :
: : while(!Terminated && ClientSocket->Connected) {
: : try {
: : pStream = new TWinSocketStream(ClientSocket, 60000);
: : try {
: : memset(Buffer, 0, BUFFER_SIZE); // initialize the buffer
: : // give the client 60 seconds to start writing
: : if(pStream->WaitForData(60000)) {
: : if(pStream->Read(Buffer, BUFFER_SIZE) == 0) { // <-- 이부분이 에러가 납니다
: : ClientSocket->Close(); // if can read in 60 seconds, close the connection
: : } // if
: : // now process the request
:
: TWinSocketStream 객체 생성 부분이 while loop 내부에 있어야 하는것이 맞나요?
: loop 안의 코드가 어떻게 진행될지 모르지만, 일단 pStream에 계속 새로운 객체가 생성되어 발생하는 문제같습니다.
try {
pStream = new TWinSocketStream(ClientSocket, 60000);
while(!Terminated && ClientSocket->Connected) {
try {
memset(Buffer, 0, BUFFER_SIZE); // initialize the buffer
// give the client 60 seconds to start writing
if(pStream->WaitForData(60000)) {
if(pStream->Read(Buffer, BUFFER_SIZE) == 0) { // <-- 역시 이부분에 같은 에러가 발생하네요.
ClientSocket->Close(); // if can read in 60 seconds, close the connection
} // if
// now process the request
제가 기본 지식이 부족해서 그런건지 ....
원인을 아시는 분 답변 부탁드립니다.
그리고 TServerSocket, TClientSocket관련 문서 stThreadBlocking, stNonBlocking 관련 문서 등등이 자세히좀 나와있는 곳을 아시면 좀 알려주세요 참고할 만한 서적을 보유하지도 못하고 인터넷 정보를 참고삼아 프로그래밍 하고 있는데 bcb는 msdn만큼 도움말이 자세하지 않아서 많이 힘이 드네요 ... 부탁합니다.
|