begin
ServerSocket:=TServerSocket.Create(self) ;
ClientSocket:=TClientSocket.Create(self);
StrTemps := StrSeverID + StrDate + StrReNum;
StrLocalStr := StrTemps;
Isserver:=false;
ServerSocket.Active :=true;
ServerSocket.Port:=1024;
ClientSocket.Host := '10.8.2.97';
ClientSocket.Address := '10.8.2.97';
ClientSocket.Port:=1024;
CreatConnection;
ClientSocket.Socket.SendText(StrLocalStr);
{传送本地字符串StrLocalStr}
if Isserver=true then
begin
ClientSocket.Socket.SendText(StrLocalStr);
StrLocalStr:=ClientSocket.Socket.ReceiveText;
end;
{得到返回字符串GetStrWhole}
result := ClientSocket.Socket.ReceiveText;
ClientSocket.Close;
end;