-
Notifications
You must be signed in to change notification settings - Fork 1
/
Unit3.pas
54 lines (47 loc) · 890 Bytes
/
Unit3.pas
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Classes, Forms, Sockets;
type
TStatus = class(tthread)
private
IP, Port: String;
protected
procedure execute; override;
public
property IPs: string read IP write IP;
property Ports: string read Port write Port;
end;
implementation
Uses Unit1;
procedure TStatus.execute;
Var
TCP: TTcpClient;
begin
TCP := TTcpClient.Create(nil);
TCP.WaitForData(100);
TCP.RemoteHost := IP;
TCP.RemotePort := Port;
TCP.Connect;
if TCP.Connected = False then
case StrToInt(Port) of
27780:
statrf := False;
25565:
statmc := False;
27010:
statcs := False;
end
else
case StrToInt(Port) of
27780:
statrf := True;
25565:
statmc := True;
27010:
statcs := True;
end;
TCP.Disconnect;
TCP.Destroy;
end;
end.