Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Internet (https://www.clubdelphi.com/foros/forumdisplay.php?f=3)
-   -   Necesito ayuda urgente, please!!! (https://www.clubdelphi.com/foros/showthread.php?t=2583)

chabbertd 29-07-2003 20:46:31

Necesito ayuda urgente, please!!!
 
soy nuevo usando las Indy y necesito enviar a través de una LAN lo siguiente.

Datos = array[1..3]of byte;

uso los componentes IdUDPServer e IdUDPClient, en la aplicación cliente hago lo siguiente, en el evento OnClick de un boton:

procedure TForm1.BEnviarClick(Sender: TObject);
var Buffer:Datos;
begin
Buffer[1]:=horas;
Buffer[2]:=minutos;
Buffer[3]:=segundos;
Client.SendBuffer(Buffer,SizeOf(Buffer));
end;

¿Como tendría que hacer para recibir y acceder a éstos datos en la aplicación servidor?
Lo que estaba haciendo es lo siguiente:

procedure TForm1.ServerUDPRead(Sender: TObject; AData: TStream; ABinding: TIdSocketHandle);
var Buffer:array of byte;
begin
SetLength(Buffer,AData.Size);
AData.Position:=0;
AData.ReadBuffer(Buffer,Length(Buffer));
H:=Buffer[1];
M:=Buffer[2];
S:=Buffer[3];
end;

Pero no llegan los datos al servidor :confused: Como tendria que hacerlo?


La franja horaria es GMT +2. Ahora son las 04:34:31.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi