简体   繁体   English

在 Delphi 2007 和 Delphi 11.1 之间对 Indy10 的更改

[英]Changes to Indy10 between Delphi 2007 and Delphi 11.1

I have some really old code that was compiled with the version of Indy10 that was included in Delphi 2007. Having recompiled this in Delphi 11.1 the TCP Clients that should connect to the server application no longer do so.我有一些非常旧的代码是用包含在 Delphi 2007 中的 Indy10 版本编译的。在 Delphi 11.1 中重新编译后,ZB136EF5F6A01D816991FE3CF7A6AC7 客户端不再应该连接到服务器应用程序。 I'm trying to connect to the server using 127.0.0.1 on port 50000. Instead I get "connection timeout" or "socket operation on a non-socket" errors.我正在尝试使用端口 50000 上的 127.0.0.1 连接到服务器。相反,我收到“连接超时”或“非套接字上的套接字操作”错误。

Is there any documentation anywhere that details what has changed between Indy10 in Delphi 2007 and Delphi 11.1?是否有任何文档详细说明 Delphi 2007 中的 Indy10 和 Delphi 11.1 之间发生了什么变化? All the links on the Indy Project website are broken so I haven't found anything there. Indy Project 网站上的所有链接都已损坏,所以我在那里没有找到任何东西。 According to the Log at the start of IdTCPClient.pas there are no changes between the two however a quick file comparison reveals quite a few changes including the change of Port value from Integer to TIdPort.根据 IdTCPClient.pas 开头的日志,两者之间没有变化,但是快速文件比较显示了很多变化,包括端口值从 Integer 到 TIdPort 的变化。 I've recompiled our server application in Delph11.1 and it will accept connections from older clients compiled in Delphi 2007 but not from new clients (hence I suspect changes IdTCPClient may be giving me issues).我在 Delph11.1 中重新编译了我们的服务器应用程序,它将接受来自在 Delphi 2007 中编译的旧客户端的连接,但不接受来自新客户端的连接(因此我怀疑 IdTCPClient 的更改可能会给我带来问题)。 Thanks in advance for any help.提前感谢您的帮助。

The code that tries to open the connection is below;尝试打开连接的代码如下;

function TClientServer.Connect(SuppressMsg : Boolean) : Boolean;
begin
  Result := False;
  if (FRunning = False) and (Connecting = False) then
  begin
    try
      TCPClient.ConnectTimeout := FConnectTimeout;
      Connecting := True;
      if assigned(TCPClient.IOHandler) then
      begin
          TCPClient.IOHandler.ConnectTimeout := FConnectTimeout;
          TCPClient.IOHandler.MaxLineAction  := maSplit;
      end;

      TCPClient.Connect;
      Result      := True;
    except on E : Exception do
      begin

        Connecting := false;
        if SuppressMsg = False then
        begin
          { Look at cycling through the servers in the FCoreServer list   }
          { until we manage to connect to one. Perhaps we need to prompt  }
          { the user to select the machine to connect to ?                }
          ShowMessage('Failed to connect to the core server !' + #13#10#10 +
                    'Please ensure server is running at address ' +
                    TCPClient.Host + ' (' + IntToStr(TCPClient.Port) + ')' + #13#10 + E.Message );
        end;
       end;
    end;
  end;
end;

Having recompiled this in Delphi 11.1 the TCP Clients that should connect to the server application no longer do so.在 Delphi 11.1 中重新编译后,应该连接到服务器应用程序的 TCP 客户端不再这样做。 I'm trying to connect to the server using 127.0.0.1 on port 50000. Instead I get "connection timeout" or "socket operation on a non-socket" errors.我正在尝试使用端口 50000 上的 127.0.0.1 连接到服务器。相反,我收到“连接超时”或“非套接字上的套接字操作”错误。

I know for a fact that Indy works on localhost, so the problem has to be with either your setup or your environment.我知道 Indy 在 localhost 上工作的事实,所以问题必须与您的设置或您的环境有关。 But you did not provide any details about either one.但你没有提供任何一个的任何细节。

Is there any documentation anywhere that details what has changed between Indy10 in Delphi 2007 and Delphi 11.1?是否有任何文档详细说明 Delphi 2007 中的 Indy10 和 Delphi 11.1 之间发生了什么变化?

There is Indy's blog that describes some of the more user-facing changes that have been made over time. Indy 的博客描述了随着时间的推移所做的一些更面向用户的更改。 But for more detailed changes, you would have to look at the source code change history in Indy's GitHub repo .但是对于更详细的更改,您必须查看Indy 的 GitHub 存储库中的源代码更改历史记录。

All the links on the Indy Project website are broken Indy Project 网站上的所有链接都已损坏

Known issue: https://www.indyproject.org/2021/02/10/links-to-old-indy-website-pages-are-currently-broken/ I just haven't had any time to fix it yet.已知问题: https://www.indyproject.org/2021/02/10/links-to-old-indy-website-pages-are-currently-broken/我只是还没有时间修复它。

According to the Log at the start of IdTCPClient.pas there are no changes between the two根据 IdTCPClient.pas 开头的日志,两者之间没有变化

The change logs that are stored in the source files themselves are very old.存储在源文件本身中的更改日志非常旧。 They are leftovers from when Indy used TeamCoherence as its VCS many years ago.它们是 Indy 多年前使用 TeamCoherence 作为其 VCS 时的遗留物。 When Indy switched from TC to SVN (and then later to GitHub), new change logs are no longer stored in the source file themselves.当 Indy 从 TC 切换到 SVN(然后是 GitHub)时,新的更改日志不再存储在源文件本身中。 I've been wanting to either remove the old logs, or put a final "these are old" comment in them, for a long time.很长一段时间以来,我一直想删除旧日志,或者在其中添加最终的“这些都是旧的”评论。

I've recompiled our server application in Delph11.1 and it will accept connections from older clients compiled in Delphi 2007 but not from new clients (hence I suspect changes IdTCPClient may be giving me issues).我在 Delph11.1 中重新编译了我们的服务器应用程序,它将接受来自在 Delphi 2007 中编译的旧客户端的连接,但不接受来自新客户端的连接(因此我怀疑 IdTCPClient 的更改可能会给我带来问题)。

I am not aware of any changes that would be breaking the connection.我不知道会破坏连接的任何更改。 It should be working fine.它应该工作正常。 But, without seeing your setup and environment, there is no way to know what could possibly be preventing the connection.但是,如果没有看到您的设置和环境,就无法知道可能阻止连接的原因。

I finally found the problem;我终于找到了问题; the changes to Indy10 are a red herring. Indy10 的变化是红鲱鱼。 My project was using FastMM in several units and for some strange reason when I commented out all instances it worked.我的项目在几个单元中使用 FastMM,当我注释掉它工作的所有实例时,出于某种奇怪的原因。 The client now happily connects to the server.客户端现在愉快地连接到服务器。 @RemyLebeau - thanks so much for all your help with this and quite a few other questions I've posted over the last few months. @RemyLebeau - 非常感谢您在这方面的所有帮助以及我在过去几个月中发布的许多其他问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM