Client:
1. SendData: if sock.Connected then
begin
sock.IOHandler.ReadBytes(rxbuf,Count,False);
Move(rxbuf[0],buf,Length(rxbuf));
end;
2. ReciveData: if not sock.Connected then exit ;
SetLength(txbuf,Count);
Move(buf,txbuf[0],Count);
sock.IOHandler.Write(txbuf);
Server:onexecute:
AContext.Connection.IOHandler.ReadBytes(txbuf,0,True);
Hinst:=LoadLibrary('abc.dll');
if Hinst>0 then
try
FPointer:=GetProcAddress(Hinst,'start');
if FPointer<>nil then begin
MyFunc:=TMyAbout(FPointer);
MyFunc(PChar(EditLicense.Text),PChar(EditAppName.Text));
end
else Memo1.Lines.Add('>>未找到相应的函数!');
finally
FreeLibrary(Hinst);
end
else Memo1.Lines.Add('>>DLL未加载成功!');
AContext.Connection.IOHandler.Write(txbuf);
--下面是我从服务器端取回数据的记录:
客户端启动Connected at 2007-12-10 17:01:55
服务器回应-->Test Program
(SendPacket) <--55 55 55 55 AA AA AA AA 01 00 00 00 01 00 00 00 2C 00 00 00 11111111 Test_Program