F
fire.bruin
Unregistered / Unconfirmed
GUEST, unregistred user!
......
const
ServerIP = '192.168.0.1';
ServerPORT = 51937;
.....
procedure TForm_into.FormCreate(Sender: TObject);
Var
wsaData: TWSAData;
ListenSocket: TSOCKET;
InternetAddr: TSockAddrin;
tmpPacket: array [0..1023] of byte;
begin
WSAStartup(makeword(2, 0), wsaData);
ListenSocket := WSASocket(AF_INET, SOCK_STREAM, 0, nil, 0, WSA_FLAG_OVERLAPPED);
InternetAddr.sin_family := AF_INET;
InternetAddr.sin_addr.s_addr := inet_addr(ServerIP);
InternetAddr.sin_port := htons(ServerPORT);
//下面一句总是报错 Incompatible types:'TSockAddrIn' and 'PSockAddr'
connect(ListenSocket, InternetAddr, sizeof(InternetAddr));
.......
end
const
ServerIP = '192.168.0.1';
ServerPORT = 51937;
.....
procedure TForm_into.FormCreate(Sender: TObject);
Var
wsaData: TWSAData;
ListenSocket: TSOCKET;
InternetAddr: TSockAddrin;
tmpPacket: array [0..1023] of byte;
begin
WSAStartup(makeword(2, 0), wsaData);
ListenSocket := WSASocket(AF_INET, SOCK_STREAM, 0, nil, 0, WSA_FLAG_OVERLAPPED);
InternetAddr.sin_family := AF_INET;
InternetAddr.sin_addr.s_addr := inet_addr(ServerIP);
InternetAddr.sin_port := htons(ServerPORT);
//下面一句总是报错 Incompatible types:'TSockAddrIn' and 'PSockAddr'
connect(ListenSocket, InternetAddr, sizeof(InternetAddr));
.......
end