1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32:
| unit UdpClass;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdUDPServer, IdBaseComponent, IdComponent, IdUDPBase, IdUDPClient, IdGlobal, IdSocketHandle;
type UdpTestClass = class(TObject) client : TIdUDPClient; procedure createSocket(ip : string; port : integer); procedure IdUDPServer1UDPRead(Sender: TObject; AData: TBytes; ABinding: TIdSocketHandle); end;
implementation procedure UdpTestClass.createSocket(ip: string; port: Integer); begin try client.Host := ip; client.Port := port; client.Active := True; except Writeln('Fehler beim Verbinden des Clients.'); end; end;
procedure UdpTestClass.IdUDPServer1UDPRead(Sender: TObject; AData: TBytes; ABinding: TIdSocketHandle); begin
end;
end. |