Please, help me to solve such a problem:
I'm writing server-application (SA) and client-application (CA) in C++ Builder 6 under Windows OS.
In CA I'm using TClientSocket's component ClientSocketSta t and in SA TServerSocket's component ServerSocketSta t to exchange information.
On ServerSocketSta t's event OnGetSocket I initialize and start cStatThread's thread object ( class cStatThread is derived from TServerClientTh read)
This is cStatThread's constructor:
This is cStatThread's ClientExecute method:
Maybe I've forgot something?
But the most interesting that the same code in other application does'nt make any exceptions.
I'm writing server-application (SA) and client-application (CA) in C++ Builder 6 under Windows OS.
In CA I'm using TClientSocket's component ClientSocketSta t and in SA TServerSocket's component ServerSocketSta t to exchange information.
On ServerSocketSta t's event OnGetSocket I initialize and start cStatThread's thread object ( class cStatThread is derived from TServerClientTh read)
Code:
void __fastcall TForm1::ServerSocketStatGetSocket(TObject *Sender,
int Socket, TServerClientWinSocket *&ClientSocket)
{
ClientSocketN=new TServerClientWinSocket(Socket,ServerSocketStat-> Socket;
cStatThread* sthr=new cStatThread(true,ClientSocket);
sthr->Resume();
}
Code:
__fastcall cStatThread::cStatThread(bool CreateSuspended, TServerClientWinSocket* aSocket)
: TServerClientThread(CreateSuspended,aSocket) {}
Code:
...............
TWinSocketStream* statStream;
try{statStream=new TWinSocketStream(ClientSocket,5000);}
//[B]after this line I receive Exception Message "Socket must be in blocking mode". But either ServerStatSocket or ClientStatSocket are in blocking modes
(stThreadBlocking and ctBlocking)[/B]
.................
But the most interesting that the same code in other application does'nt make any exceptions.