Is it possible to have two or more Server components in one Delphi project serving different Librarys or Services?

(aruge) #1

We want to build a service with two communication “sides”. One internally and one externally (on different ports).
Is it possible to have two Server components in one Delphi project to expose different RemObjects services or RemObjects library’s?
If not is it possible to detect the Server, Channel or Message component name within the Service implementation so that we can raise an exception when a call is executed from an invalid client port?

Best regards
Andreas Ruge

(EvgenyK) #2

yes, it is possible.
you can use several server components in the same project.

(aruge) #3

Yes, I know that. That was not the question.
Is it possible to link a different service or library to the server components?
Or detect from which server component the function/method was called?

(EvgenyK) #4

yep, you can detect this in GetDispatchInfo event (see example in Receiving information about client on server-side snippet).

I recommend to use different server components like HTTP/SuperHTTP and TCP/SuperTCP.
in this case, you can easily distinguish them.

also you can use Roles. your internal users can use specific role.

(aruge) #5

Thank you. That helped.

I solved it by using a custom class derived from TROBinMessage (implementing an interface of my own) with one custom property. In the GetDispatchInfo I check the interface en validate the custom property.