Im currently trying to use my Client with a Chilkat library since the Client has to be written in Visual C++ and not Borland C++(C++Builder).
Connecting does work but as soon I try to send a string from the Client to the Server it doesn't even hit the IdTCPServerExecute
Function.
Is it even possible to use another library for the Client than the Server is using? If so, how?
Edit: I got it working that the Client successfully sends a string to the server. I now handle the Client message like this:
UnicodeString Message = AContext->Connection->Socket->AllData();
Instead of:
UnicodeString Message = AContext->Connection->Socket->ReadLn();
Now is there a simliar option to send the response string from the server?
if (IdHTTP->Get
("http://*/index.php?option=com_bookpro&controller=customer&task=bpajaxlogin&username=" +
slTokens->Strings[1] + "&password=" + slTokens->Strings[2] +
"&product_id=" + Class) == "true") {
AddLog("1");
char* Response = "Test";
AContext->Connection->Socket->Write(Response);
AddLog("2");
}
else {
AContext->Connection->Socket->WriteLn
("Authentication failed");
}
It also only comes to AddLog("1");
and does not display AddLog("2");
.
Client Code(using Winsocks for tests atm.):
recv(ConnectSocket, recvbuf, recvbuflen, 0);
printf("Bytes received: %d, %s\n", sizeof(recvbuf), recvbuf);