| 33 |
{ |
{ |
| 34 |
CString out,cmd; |
CString out,cmd; |
| 35 |
char temp[256]; |
char temp[256]; |
| 36 |
|
HANDLE hThreadCurrent; |
| 37 |
|
|
| 38 |
try |
try |
| 39 |
{ |
{ |
| 40 |
|
hThreadCurrent = GetCurrentThread(); |
| 41 |
|
|
| 42 |
out.Format("200 %s ready.",App_common::GetVersion()); |
out.Format("200 %s ready.",App_common::GetVersion()); |
| 43 |
this->s_send(out); |
this->s_send(out); |
| 44 |
while(!this->thread_terminate) |
while(!this->thread_terminate) |
| 45 |
{ |
{ |
| 46 |
|
this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WAITING); |
| 47 |
|
|
| 48 |
if (this->s_receive(out) == 0) //Connection closed |
if (this->s_receive(out) == 0) //Connection closed |
| 49 |
break; |
break; |
| 50 |
out.Trim(); |
out.Trim(); |
| 51 |
|
|
| 52 |
|
this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WORKING); |
| 53 |
|
|
| 54 |
syslog << logfile::log_head << "Cmd: " << out << endl; |
syslog << logfile::log_head << "Cmd: " << out << endl; |
| 55 |
|
|
| 56 |
if (sscanf(out,"%20s",temp) ==1) |
if (sscanf(out,"%20s",temp) ==1) |