Skip to content

WebSocket between Applications ? #908

Closed

Description

@itg-assistant

Adil Battal KAYA asked 2017-06-20 09:19:39 UTC

Hi

I have two wisej applications that run on same IIS. Question is how could I send a websocket message between them. Simply, by using your Simple Chat example in two diffrent applications, how could I send message from one to another application.

Thank you.

Activity

  1. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2017-06-20 15:07:34 UTC

    Hi Adil,

    WebSocket is a browser feature, you cannot open a websocket client from a server process. (you could using a browser process, or creating a websocket client, but it's extremely messy).

    If your apps are on the same IIS and on the same  pool they can share static variables making it very easy for two or more apps to communicate by sharing memory.

    HTH

    /Luca

  2. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Adil Battal KAYA answered 2017-06-20 16:17:53 UTC

    Thanks Luca. My case is;

    I am trying to do an application like google cloud messaging by using wisej. For example, I can have a list of authanticeted users's sessionids from A application. A app already has websocket lines with sessionids in background and chat works inside it. From B application, that can also be a win console app, we opens a websocket connection to A application by using sessionids. Then from B app I am sending a message and on the A app the Application.Update event trigered. So messege can be delivered from B to A.

    Is this possible. If yes, can you provide me an example or extend your Simple Chat example.

    Thank you.

  3. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2017-06-20 16:28:59 UTC

    I'm not fully sure I understood. You have a chat-type app (A) as a wisej web app running in IIS. Then you have a similar app (B) running as a windows console app that also wants to chat with A?

    If that's the case, it would be very hard to emulate a websocket client in a console app. This is more a case for a web service that you can use from B.

    If A and B are both running in IIS, I'd use an event model, one of the two or both can publish static events and subscribe to each other's.

  4. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Adil Battal KAYA answered 2017-06-20 18:06:38 UTC

    Actually I need both of them as Wisej running on the same IIS. Can you provide a sample.

  5. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2017-06-21 16:44:38 UTC

    I'd need some more info for an example. I don't quite understand what the second application should do. But...

    Look athe SimpleChat example in /examples. There is a static class SimpleChatServer. You can simply add a reference to the SimpleChat assembly to your second application and from there you can:

    1- Receive notifications when there is an incoming message by attaching to SimpleChatServer.IncomingMessage.

    2- Join or Leave the chat using a unique name: SimpleChatServer.Join/Leave()

    3-Send a message from the other app: SimpleChatServer.SendMessage(name, text).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions