# Remote Server existing in multiple threads

**URL:** https://talk.remobjects.com/t/remote-server-existing-in-multiple-threads/34275
**Category:** Remoting SDK
**Tags:** delphi
**Created:** [November 4, 2026, 3:51pm UTC](https://talk.remobjects.com/t/remote-server-existing-in-multiple-threads/34275 "2026-11-04T15:51:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mikek](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@mikek](https://talk.remobjects.com/u/mikek)
#### Post date: [November 4, 2026, 3:51pm UTC](https://talk.remobjects.com/t/remote-server-existing-in-multiple-threads/34275/1 "2026-11-04T15:51:28Z")

</div>

Sorry, I’m new to working with RemObjects from the server side. I’ve done client side applications before (a different developer handled the server side), but even that has been a while.

I think what I’m looking for can be done, but I’m not sure as to how to properly set it up.

I have an application that has multiple threads that each access their own instance of a couple of COM objects. Those calls now need to be split off into a 64 bit application, as the application they are in must stay 32 bit (due to other dependencies).

My thought was to create a 64 bit application that would be a server. I wanted to create a separate thread for each thread the client has that accesses those COM objects, and have an instance of the RO server in each thread. This would allow me to have a separate instance of the COM objects for each thread. Then when a client call went out, it would go to each of these instances of the server. One of the parameters passed would be a thread ID to let the server know which thread should do the processing (as the COM objects have persistent data in each of them.)

I know the RO server can spin off threads on its own to handle multiple simultaneous client calls, but I would lose the persistent data of the COM objects.

Basically what I’m looking for is a Stateful Server option, where I’d have one instance of the server for each Client that would connect. I understand this can lead to scaling issues, but my Client connections should never exceed a dozen or two at most.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [November 4, 2026, 7:20pm UTC](https://talk.remobjects.com/t/remote-server-existing-in-multiple-threads/34275/2 "2026-11-04T19:20:34Z")

</div>

Hi,

in past, we have issues with communication 32-bit COM clients with 64-bit COM server in Hydra, so you may have issues with it with Remoting SDK too.

I can recommend to review possibility to create usual [super] http/tcp server w/o using COM objects. it can be easily done with our new project wizard.

---

<div class="post-metadata">

### Author: ![mikek](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@mikek](https://talk.remobjects.com/u/mikek)
#### Post date: [November 4, 2026, 7:46pm UTC](https://talk.remobjects.com/t/remote-server-existing-in-multiple-threads/34275/3 "2026-11-04T19:46:36Z")

</div>

Sorry for the mis-communication. I’m not planning on using COM objects for RO, the COM is a 3rd party COM library that I need to make calls to. I’d planned on using Super TCP and BINMessages to pass data back and forth between the old 32 bit app and the new 64 bit app.

The trick is to have multiple threads in the 64 bit app (which I will have created already with the COM references) each able to process the calls from the 32 bit app in the appropriate thread.

My general understanding of Client Server setups is that you have multiple clients, but only one server. I was wondering if a SessionManager would allow me to either have multiple instances of the server, one for each thread, then only handle the call if the “ThreadID” parameter matches the “ThreadID” stored in that thread. That way each thread would have it’s own instance of the COM objects I need to communicate to, with their own persistent data inside of the COM object.

I’ve passed the idea into Claude and it seems to believe it is possible to do this even without a SessionManager by having each thread in the 32 bit app do a RO call to create a thread on the 64 bit app when the 32 bit thread is initialized, then for the actual COM calls the RO call would include the thread name (along with any parameters the COM call needs). The 64 bit app would then search the list of threads created by those initialize calls, find the thread with the correct thread name (effectively the Thread ID I mentioned originally) and process the RO call in that thread through an anonymous method. I’m starting the process to see if I can get that to work, as AI isn’t always entirely reliable.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [November 5, 2026, 4:41am UTC](https://talk.remobjects.com/t/remote-server-existing-in-multiple-threads/34275/4 "2026-11-05T04:41:10Z")

</div>

Hi,

we have several class factories - [Class Factories (.NET & Delphi)](https://remotingsdk.docs.remobjects.com/Servers/Concepts/ClassFactories/) artyicle decribes them .

For your situation, I think, more suitable can be

- [Per-Client](https://remotingsdk.docs.remobjects.com/Servers/Concepts/PerClientClassFactory/) instantiation - every client will be served by a distinct service instance.

Note: review other class factories too, probably other class factories are suitable too.
