Commit bf7d9c1b by NitefullWind

1. 等待POS关闭Socket后外挂再断开Socket。 2. 修复其他bug。

parent 1d34495b
...@@ -212,13 +212,22 @@ void FMSockServer::RecvRoutine(DWORD err, DWORD bytes, LPWSAOVERLAPPED overlappe ...@@ -212,13 +212,22 @@ void FMSockServer::RecvRoutine(DWORD err, DWORD bytes, LPWSAOVERLAPPED overlappe
io_data->relay->Transfer(io_data->msg, response, len); io_data->relay->Transfer(io_data->msg, response, len);
} }
if (response) { if (response) {
FMLOG("Transfered %s", response);
send(io_data->socket, response, len, 0); send(io_data->socket, response, len, 0);
FMLOG("Transfered %s", response);
} }
else { else {
FMLOG(_T("Failed to determine response data.")); FMLOG(_T("Failed to determine response data."));
} }
closesocket(io_data->socket); HANDLE closeEvent = WSACreateEvent();
WSAEventSelect(io_data->socket, closeEvent, FD_CLOSE);
DWORD dwRet = WaitForSingleObject(closeEvent, 5000);
// if(dwRet == WSA_WAIT_EVENT_0) {
closesocket(io_data->socket);
// }
WSACloseEvent(closeEvent);
//! Free all buffer //! Free all buffer
HeapFree(GetProcessHeap(), 0, io_data); HeapFree(GetProcessHeap(), 0, io_data);
......
...@@ -7,10 +7,6 @@ ...@@ -7,10 +7,6 @@
<file>chk_checked.png</file> <file>chk_checked.png</file>
<file>chk_unchecked.png</file> <file>chk_unchecked.png</file>
<file>img_logo.png</file> <file>img_logo.png</file>
<file>data/coupon</file>
<file>data/order</file>
<file>data/profile</file>
<file>data/user</file>
<file>loading.gif</file> <file>loading.gif</file>
<file>alert_bg.png</file> <file>alert_bg.png</file>
<file>tip_warning.png</file> <file>tip_warning.png</file>
......
...@@ -77,6 +77,10 @@ void TaskManage::doChildTask() ...@@ -77,6 +77,10 @@ void TaskManage::doChildTask()
posRspJsonObj[prop] = (*childRsp)[prop]; posRspJsonObj[prop] = (*childRsp)[prop];
} }
if(childTask->error() == FM_API_WINDOWCLOSE) {
return;
}
closeWindow(); closeWindow();
} }
......
...@@ -25,7 +25,7 @@ void FMVipPanel::initWnd(Session *session) ...@@ -25,7 +25,7 @@ void FMVipPanel::initWnd(Session *session)
ui->operator_label->setText(session->data(PosProps.OperatorId).toString()); ui->operator_label->setText(session->data(PosProps.OperatorId).toString());
ui->bd_label->setText(session->data(PosProps.BussinessDate).toString()); ui->bd_label->setText(session->data(PosProps.BussinessDate).toString());
ui->id_label->setText(session->data(PosProps.Fm_open_id).toString()); ui->id_label->setText(session->data(PosProps.Fm_open_id).toString());
ui->balance_label->setText(QString::number(session->data(PosProps.Amount).toInt() / 100.0)); ui->balance_label->setText(DOUBLE_STR(session->data(PosProps.Amount).toInt() / 100.0));
ui->name_label->setText(session->data(PosProps.Name).toString()); ui->name_label->setText(session->data(PosProps.Name).toString());
ui->bir_label->setText(session->data(PosProps.Birthday).toString()); ui->bir_label->setText(session->data(PosProps.Birthday).toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment