문제

PROBLEM:

I'm using a ZLibCompression filter in DataSnap-XE server.

The client always gives the follow error the message:

"Borland.Data.TDBXError:Communication filter ZLibCompression is not registered. Filter class needs to be registered in order to communicate with the server"

QUESTION: 1

How do I register ZLibCompression filter ?

EDIT

QUESTION: 2

How do I get the Datasnap-Connection in the DataExplorer to link to this server?

도움이 되었습니까?

해결책

Just add the DbxCompressionFilter unit to the uses clause of the client (as also discussed in my Delphi XE DataSnap courseware manual, and I believe it's also in the old DataSnap white paper that I wrote last year).

The DbxCompressionFilter unit already contains the following code:

initialization
  TTransportFilterFactory.RegisterFilter(TTransportCompressionFilter);

finalization
  TTransportFilterFactory.UnregisterFilter(TTransportCompressionFilter);

end.

다른 팁

Call the TTransportFilterFactory.RegisterFilter method in order to register a filter.

Documentation (Filtering DataSnap) says:

A filter needs to be registered with the TTransportFilterFactory singleton. The recommended way to register a filter is through the unit initialization and finalization sections, but it can be coded through an initialization phase in the user's application. Below is the code snippet registering the compression filter available out of the box:
initialization
  TTransportFilterFactory.RegisterFilter(TTransportCompressionFilter);

finalization
  TTransportFilterFactory.UnregisterFilter(TTransportCompressionFilter);

Change TTansportcompressionFilter for the name of the class you're using to filter.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top