T
truest9
Unregistered / Unconfirmed
GUEST, unregistred user!
在一个屏幕广播的程序中(发送方),有如下代码,我看不懂
procedure TForm1.FormCreate(Sender: TObject);
var
bcd : bool;
begin
WSAStartup($202,asd);
sImage := Socket(AF_INET,SOCK_DGRAM,0);
bcd := True;
SetSockOpt(sImage,SOL_SOCKET,SO_BROADCAST,pchar(@bcd),sizeof(bcd));
Local.sin_family := AF_INET;
Local.sin_port := 0;
Local.sin_addr.S_addr := htonl(INADDR_ANY);
Bind(sImage,Local,sizeof(TSockAddrIn));
Dest.sin_family := AF_INET;
Dest.sin_port := htons(6666);
Dest.sin_addr.S_addr := htonl(INADDR_BroadCast);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
bcd : bool;
begin
WSAStartup($202,asd);
sImage := Socket(AF_INET,SOCK_DGRAM,0);
bcd := True;
SetSockOpt(sImage,SOL_SOCKET,SO_BROADCAST,pchar(@bcd),sizeof(bcd));
Local.sin_family := AF_INET;
Local.sin_port := 0;
Local.sin_addr.S_addr := htonl(INADDR_ANY);
Bind(sImage,Local,sizeof(TSockAddrIn));
Dest.sin_family := AF_INET;
Dest.sin_port := htons(6666);
Dest.sin_addr.S_addr := htonl(INADDR_BroadCast);
end;