IdTCPServer1
Server本身就支持多线程,一个服务端连接多个客户端。
void __fastcall TForm2::IdTCPServer1Execute( TIdContext * AContext ) { AContext->Binding->PeerIP; AContext->Binding->PeerPort; AContext->Connection->IOHandler->SendBufferSize; AContext->Connection->IOHandler->Write( ); AContext->Connection->IOHandler->WriteFile( ); AContext->Connection->IOHandler->WriteDirect( ); AContext->Connection->IOHandler->WriteLn( ); AContext->Connection->IOHandler->Readable( ); AContext->Connection->IOHandler->ReadByte( ); AContext->Connection->IOHandler->ReadBytes( ); AContext->Connection->IOHandler->ReadChar( ); AContext->Connection->IOHandler->ReadStream( ); AContext->Connection->IOHandler->ReadString( ); AContext->Connection->IOHandler->ReadStrings( ); AContext->Connection->IOHandler->ReadInt16( ); }
时间: 2024-11-07 00:02:18