السلام عليكم
حبيت استفسلر على بعض دوال الدلفي
في دوال في دلفي كبيره وحبب اعرف عليه اكثر او كيف يتم تعمل معها
مثال دالة :
1------------
uses
Winsock;
function PortTCP_IsOpen(dwPort: Word; ipAddressStr: AnsiString): boolean;
var
client: sockaddr_in;
sock: Integer;
ret: Integer;
wsdata: WSAData;
begin
Result := False;
ret := WSAStartup($0002, wsdata); //initiates use of the Winsock DLL
if ret <> 0 then
exit;
try
client.sin_family := AF_INET; //Set the protocol to use , in this case (IPv4)
client.sin_port := htons(dwPort);
//convert to TCP/IP network byte order (big-endian)
client.sin_addr.s_addr := inet_addr(PAnsiChar(ipAddressStr));
//convert to IN_ADDR structure
sock := socket(AF_INET, SOCK_STREAM, 0); //creates a socket
Result := connect(sock, client, SizeOf(client)) = 0;
//establishes a connection to a specified socket
finally
WSACleanup;
end;
end;2-------
if PortTCP_IsOpen( 23, '192.168.1.1') then
ShowMessage('Open')
else
ShowMessage('Not Open');هنا لعمل الدالة بشكل صحيح يجد اضتها كلها . الدالة مراح تعمل الى با نصف الاول
سوال : نصف رقم 1 ايش دورها او ماذ يعني
كيف يتم تعامل مع هيك دوال
وشكرا