Firebird事件和防火墙问题(TIBEvents) [英] Firebird Events and Firewall Issue (TIBEvents)

查看:101
本文介绍了Firebird事件和防火墙问题(TIBEvents)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我会在带有TIBEvents组件的delphi应用程序中使用 Firebird事件的功能。

I would use the power of Firebird Events with delphi application with TIBEvents component.

问题是防火墙,并非每次都有正确的作用,当我尝试注册事件时,应用程序停止响应,我必须等待...

The problem is the firewall, not every time have the correct role and when I try to register the events the application stops responding and I must wait...

我该怎么办?

我也尝试在单独的线程中调用寄存器函数,但结果相同。

I also try to call register function in a separated thread but with the same result.

function RegisterEvents(data : Pointer) : Integer;
begin
  with Form1 do begin
    DBOspitiEvent.Registered := true; 
  end;
end; //<-- AFTER THIS, APPLICATION IS BLOCKED (for a while)

procedure TForm1.Button2Click(Sender: TObject);
var
  ThreadId : Cardinal;
  ThreadHandle : Integer;
begin
  ThreadHandle := BeginThread(nil,0,@RegisterEvents,nil,0,ThreadId);
  if ThreadHandle = 0
    then ShowMessage('Error');
end;


推荐答案

对于事件,客户端需要建立单独的连接,默认情况下,Firebird为此使用随机端口。与防火墙结合使用,会导致问题,因为例如不允许使用端口。

For events, a client needs to establish a separate connection, and by default Firebird uses a random port for this. In combination with firewalls, this leads to problems because the port is - for example - not allowed.

您可以通过编辑firebird.conf将Firebird配置为使用固定端口。并将 RemoteAuxPort 设置为固定值(例如3051),然后重新启动Firebird。然后,您可以将防火墙配置为允许该端口。

You can configure Firebird to use a fixed port, by editing firebird.conf and setting the RemoteAuxPort to a fixed value (eg 3051), and restarting Firebird. You can then configure your firewall to allow this port.

另请参见如何使用防火墙配置事件?

这篇关于Firebird事件和防火墙问题(TIBEvents)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆