Skip to content
This repository was archived by the owner on Oct 3, 2026. It is now read-only.
This repository was archived by the owner on Oct 3, 2026. It is now read-only.

Question: How to connect to server? #206

Open

Description

@eosfor

Hello colleagues, seems like i missed in all this :)

Say i've got a TSL, which defines a simple protocol and graph nodes and two messages - to add and get a node. I generated a dll file out of it and able to load it into a server instance. So i made a separate process to host this server instance.

Now i want to have a simple powershell client, which will be able to send commands to a server and receive output. So the first question is - how do i connect to a server. where do i specify server ip or host name and port? how do i authenticate against it? do i need to load the same dll into a client?

Thanks.

Activity

  1. yatli commented on May 28, 2018

    @yatli

    Yes the comm. protocol dll should also be loaded into the client. There are two ways to start a client from PS:

    • Right before you access Global.CloudStorage or anything that initializes a connection, set TrinityConfig.CurrentRunningMode = RunningMode.Client; -- this is the classical way of setting up a client. Also, if you have FanoutSearch, the module has an option to force initialization as a client.
    • A more modern approach is to use the GraphEngine.Client packages. It's still WIP but we're able to do something like TrinityClient client = new TrinityClient("trinity://127.0.0.1:5304"); client.RegisterCommunicationModlue<FanoutSearchModule>(); client.Start(); which is symmetrical with what you do with a server. This will also allow setting up authentication & support for other transports, e.g. grpc.
  2. eosfor commented on May 28, 2018

    @eosfor
    Author

    Ok, what i managed to do so far is the following.

    1. declared a comm. module by describing in TSL + protocol definitions
    module SimpleServerCommunicationModule
    {
    	protocol AddSimpleNodeProtocol;
    	protocol GetSimpleNodeProtocol;
    }
    
    1. created a simple comm module implementation
    2. Imported the comm. module to a server side like this
        public class SimpleServer
        {
            public void Start()
            {
                TrinityServer srv = new TrinityServer();
                srv.RegisterCommunicationModule<TrinityClientModule>();
                srv.RegisterCommunicationModule<SimpleCommunicationModule.SimpleCommunicationModule>();
                srv.Start();
            }
        }
    1. imported the comm. module to a client side
                TrinityClient cl = new TrinityClient("localhost:5304");
                cl.RegisterCommunicationModule<SimpleCommunicationModule.SimpleCommunicationModule>();
    
                cl.Start();

    So it seems i now able to connect. But is this a correct way? Will it change?

    But i did not try to put any data into the server yet :). Will try soon.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions