@thomasdrewermann
"Die Internet
IP kann man ja auch schlecht hinter einem Router abfragen ohne eine Verbindung ins Internet zu erzwingen."
@Duffy
Also ungefähr so ? (Hab das mal getestet und funktioniert nicht)
Code:
type
TSocketNotifyEvent = procedure (sender: TObject) of object; // eingefügt
type
TClientSocket = class(TObject)
private
FAddress: pchar;
FConnected: boolean;
FOnDisconnect: TSocketNotifyEvent;
protected
FSocket: TSocket;
public
constructor Create;
destructor Destroy; override;
procedure Connect(Address: string; Port: integer);
procedure Disconnect;
function ReceiveBuffer(var Buffer; BufferSize: integer): integer;
function ReceiveLength: integer;
function SendBuffer(var Buffer; BufferSize: integer): integer;
property Connected: boolean read FConnected;
property Socket: TSocket read FSocket;
property OnDisconnect: TSocketNotifyEvent read FOnDisconnect write FOnDisconnect; // eingefügt
end;