Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdTcpServer mixing clients
#4
Clients are identified with MAC address. Every client has its own log file. There are following successive lines in the code.

Code:
// 1. Write socket handle to log file.
LogMessage(AnsiString().sprintf("Handle %X", IdContext->Binding->Handle));
// 2. Write message data (TIdByte ByteArray) to log file.
LogData(ByteArray);
// 3. Send message
IdContext->Connection->IOHandler->Write(ByteArray, ByteArray.Length, 0);

1. Socket handle never changes.
2. Message data is correct. It is unique to client.
3. Third line sends message occasionally to wrong client.

henschen
Reply


Messages In This Thread
TIdTcpServer mixing clients - by henschen - 12-17-2018, 04:21 PM
RE: TIdTcpServer mixing clients - by kudzu - 12-17-2018, 06:19 PM
RE: TIdTcpServer mixing clients - by rlebeau - 12-17-2018, 08:43 PM
RE: TIdTcpServer mixing clients - by henschen - 12-18-2018, 06:21 PM
RE: TIdTcpServer mixing clients - by rlebeau - 12-18-2018, 09:04 PM
RE: TIdTcpServer mixing clients - by henschen - 12-19-2018, 01:26 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)