|
@ -119,7 +119,7 @@ receiveReqRet(RequestId, MonitorRef) -> |
|
|
receive |
|
|
receive |
|
|
#agReqRet{messageId = RequestId, reply = Reply} -> |
|
|
#agReqRet{messageId = RequestId, reply = Reply} -> |
|
|
erlang:demonitor(MonitorRef), |
|
|
erlang:demonitor(MonitorRef), |
|
|
Reply; |
|
|
|
|
|
|
|
|
eVpack:decode(Reply); |
|
|
{'DOWN', MonitorRef, process, _Pid, Reason} -> |
|
|
{'DOWN', MonitorRef, process, _Pid, Reason} -> |
|
|
{error, {agencyDown, Reason}} |
|
|
{error, {agencyDown, Reason}} |
|
|
end. |
|
|
end. |
|
@ -128,7 +128,7 @@ receiveReqRet(RequestId, MonitorRef) -> |
|
|
receiveTcpData(RecvState, Socket) -> |
|
|
receiveTcpData(RecvState, Socket) -> |
|
|
receive |
|
|
receive |
|
|
{tcp, Socket, DataBuffer} -> |
|
|
{tcp, Socket, DataBuffer} -> |
|
|
?AgWarn(1111, "IMY************receove 1: ~p ~p ~n", [erlang:byte_size(DataBuffer), DataBuffer]), |
|
|
|
|
|
|
|
|
%% ?AgWarn(1111, "IMY************receove 1: ~p ~p ~n", [erlang:byte_size(DataBuffer), DataBuffer]), |
|
|
case agVstProto:response(element(2, RecvState), RecvState, DataBuffer) of |
|
|
case agVstProto:response(element(2, RecvState), RecvState, DataBuffer) of |
|
|
{?AgMDone, MsgBin} -> |
|
|
{?AgMDone, MsgBin} -> |
|
|
{ok, MsgBin}; |
|
|
{ok, MsgBin}; |
|
@ -203,7 +203,6 @@ connDb(DbCfgs) -> |
|
|
{ok, MsgBin} -> |
|
|
{ok, MsgBin} -> |
|
|
case eVPack:decode(MsgBin) of |
|
|
case eVPack:decode(MsgBin) of |
|
|
[1, 2, 200, _] -> |
|
|
[1, 2, 200, _] -> |
|
|
?AgWarn(connDb_tcp, "connect and auth success~n", []), |
|
|
|
|
|
setCurDbInfo(Socket, DbName, VstSize, Protocol), |
|
|
setCurDbInfo(Socket, DbName, VstSize, Protocol), |
|
|
{ok, Socket}; |
|
|
{ok, Socket}; |
|
|
_Err -> |
|
|
_Err -> |
|
@ -228,7 +227,6 @@ connDb(DbCfgs) -> |
|
|
{ok, MsgBin} -> |
|
|
{ok, MsgBin} -> |
|
|
case eVPack:decode(MsgBin) of |
|
|
case eVPack:decode(MsgBin) of |
|
|
[1, 2, 200, _] -> |
|
|
[1, 2, 200, _] -> |
|
|
?AgWarn(connDb_ssl, "connect and auth success~n", []), |
|
|
|
|
|
setCurDbInfo(Socket, DbName, VstSize, Protocol), |
|
|
setCurDbInfo(Socket, DbName, VstSize, Protocol), |
|
|
{ok, Socket}; |
|
|
{ok, Socket}; |
|
|
_Err -> |
|
|
_Err -> |
|
|