public NewPayLoad ExecuteActionOnRemoteGridPlugin(NewPayLoad payload)
        {
            bool closeConn = false;

            if (hubClient == null)
            {
                hubClient = new GingerSocketClient2();
                hubClient.Connect(RemoteGridIP, RemoteGridPort);
                // For action without session
                NewPayLoad fpl = new NewPayLoad(SocketMessages.FindNode, "MathService", "ccc");    // !!!!!!!!!!!!!!!!
                                                                                                   // NewPayLoad fpl = new NewPayLoad(SocketMessages.FindNode, "SeleniumChromeService", "ccc");    // !!!!!!!!!!!!!!!!         DUP REMOVE !!!!
                NewPayLoad rc = hubClient.SendRequestPayLoad(fpl);

                sessionID = rc.GetGuid();
                closeConn = true;
            }
            else
            {
            }


            //  TODO: reserve if session


            NewPayLoad fpl3 = new NewPayLoad(SocketMessages.SendToNode, sessionID, payload);
            // fpl3.ClosePackage();
            NewPayLoad rc4 = hubClient.SendRequestPayLoad(fpl3); // Send to Ginger Grid which will send to Ginger Node to run the action

            if (closeConn)
            {
                hubClient.CloseConnection();   // Not for session
            }

            return(rc4);
        }
Esempio n. 2
0
        public NewPayLoad ExecuteActionOnRemoteGridPlugin(NewPayLoad payload)
        {
            // Improve for speed keep connection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! find correct service/node, session !!!!!!!!!!!!!!
            if (mHubClient == null)
            {
                mHubClient = new GingerSocketClient2();
                mHubClient.Connect(RemoteGridIP, RemoteGridPort);
            }


            NewPayLoad fpl = new NewPayLoad(SocketMessages.FindNode, "MathService", "ccc");
            NewPayLoad rc  = mHubClient.SendRequestPayLoad(fpl);

            Guid sessionID = rc.GetGuid();

            //  TODO: reserve if session

            // NewPayLoad actionPayload = CreateActionPayload(actPlugin);

            NewPayLoad fpl3 = new NewPayLoad(SocketMessages.SendToNode, sessionID, payload);
            // fpl3.ClosePackage();
            NewPayLoad rc4 = mHubClient.SendRequestPayLoad(fpl3); // Send to Ginger Grid which will send to Ginger Node to run the action

            mHubClient.CloseConnection();

            return(rc4);
            // rc4.DumpToConsole();
        }
Esempio n. 3
0
 public void Disconnect()
 {
     mGingerSocketClient2.CloseConnection();
 }