joe
Using only one thread to create and to establish the socket is not a
good choice? I don`t need one thread for each connection, do I?
I`ve one cpp: HttpSoc.cpp to create the socket - socket.create() and
socket.listen(); moreover I`ve one cpp: ConnSoc.cpp to do all the
stuff which is equal to all sockets (OnReceive, Accept, Send -
methods).
And now, I`ll need one more cpp file to handle the thread in the
accept() method?
best regards
Bernd
ok I`ve installed the third cpp class (HttpConnThread) and I get the
socket handle to this thread (after a successful accept()-method); but
after the accept()-method the OnConnect()-method won`t be called to
receive the recieved http packets....
class ConnSoc : public CAsyncSocket
virtual void OnAccept(int nErrorCode); //accept-method
virtual void OnConnect(int nErrorCode);
void ConnSoc::OnConnect(int nErrorCode)
{
TRACE("connect method not called so far");
}
void ConnSoc::OnAccept(int nErrorCode)
{
/* only some code is shown without error handling */
HttpConnThread* pThread =
(HttpConnThread*)AfxBeginThread(RUNTIME_CLASS(HttpConnThread),
THREAD_PRIORITY_NORMAL,
=