Ver Mensaje Individual
  #6  
Antiguo 08-08-2013
ASAPLTDA ASAPLTDA is offline
Miembro
 
Registrado: jun 2003
Ubicación: COLOMBIA-CALI
Posts: 639
Reputación: 21
ASAPLTDA Va por buen camino
usando indy

Cita:
Empezado por fenixariel Ver Mensaje
Código Delphi [-]

procedure TForm1.IdTCPServer1Connect(AContext: TIdContext);
begin
    Memo1.Lines.Add(DateTimeToStr(now) + ' ' + 'Connectado a : ' + AContext.Binding.PeerIP + '- Port:' + IntToStr(AContext.Binding.Port));
end;

procedure TForm1.IdTCPServer1Disconnect(AContext: TIdContext);
begin
    Memo1.Lines.Add(DateTimeToStr(now) + ' ' + 'Desconectado de : ' + AContext.Binding.PeerIP + '- Port:' + IntToStr(AContext.Binding.Port));
end;

procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
var
    Command: string;
    Size: integer;
    textoRecibido: string;
begin
    if AContext.Connection.Connected then
    begin
       
          Command := '';
          Command := AContext.Connection.Socket.ReadLn;
   
          Size := AContext.Connection.IOHandler.ReadLongInt(true);
          textoRecibido := AContext.Connection.IOHandler.ReadString(Size);
          AContext.Connection.IOHandler.WriteLn('Enviado');         
       
          Memo1.Lines.Add(DateTimeToStr(now) + ' - ' + AContext.Binding.PeerIP + ' : ' + Command);
    end;
end;


Probe enviandole mensajes desde Hercules tambien, pero solo puedo ver el momento que se conecta o desconecta el cliente pero no asi los datos enviados.



Saludos.

HOLA EN TRUS pruebas no has avanzado algo que me pueda tambien ayudar avanzar, he llegado al mimo punto y el ejmplo del otro forista no lo entiendo como debo incluirlo,
gracias
Responder Con Cita