예제 #1
0
            private static void ConnectCallback(object sender, EventArgs e)
            {
                try
                {
                    if (AlgorithmRates == null || _niceHashData == null)
                    {
                        _niceHashData  = new NiceHashData();
                        AlgorithmRates = _niceHashData.NormalizedSma();
                    }
                    //send login
                    var version = "NHML/" + Application.ProductVersion;
                    var login   = new nicehash_login
                    {
                        version = version
                    };
                    var loginJson = JsonConvert.SerializeObject(login);
                    SendData(loginJson);

                    DeviceStatus_Tick(null); // Send device to populate rig stats

                    OnConnectionEstablished.Emit(null, EventArgs.Empty);
                }
                catch (Exception er)
                {
                    Helpers.ConsolePrint("SOCKET", er.ToString());
                }
            }
예제 #2
0
            private static void ConnectCallback(object sender, EventArgs e)
            {
                try {
                    if (AlgorithmRates == null)
                    {
                        // Populate SMA first (for port etc)
                        AlgorithmRates = BaseNiceHashSMA.BaseNiceHashSMADict;
                    }
                    //send login
                    var version = "NHML/" + Application.ProductVersion;
                    var login   = new nicehash_login();
                    login.version = version;
                    var loginJson = JsonConvert.SerializeObject(login);
                    SendData(loginJson);

                    OnConnectionEstablished.Emit(null, EventArgs.Empty);
                } catch (Exception er) {
                    Helpers.ConsolePrint("SOCKET", er.ToString());
                }
            }
예제 #3
0
            private static void ConnectCallback(object sender, EventArgs e)
            {
                try
                {
                    NHSmaData.InitializeIfNeeded();
                    //send login
                    var version = "NHML/" + Application.ProductVersion;
                    var login   = new nicehash_login
                    {
                        version = version
                    };
                    var loginJson = JsonConvert.SerializeObject(login);
                    SendData(loginJson);

                    DeviceStatus_Tick(null); // Send device to populate rig stats

                    OnConnectionEstablished.Emit(null, EventArgs.Empty);
                }
                catch (Exception er)
                {
                    Helpers.ConsolePrint("SOCKET", er.ToString());
                }
            }