Exemplo n.º 1
0
        //****************************************************************************************************************


        public void Biriken_Emirleri_IslemeKoy()
        {
            bool   dosyayayaz = false;
            string str_tut = "", s2 = "", s1 = "";
            string IslemTipi = "1"; //*bekleyenemir

            Utilities utl = new Utilities();

            utl.BorsaZamanlari(ref BASZAMAN_SEANS1, ref BITZAMAN_SEANS1, ref BASZAMAN_SEANS2, ref BITZAMAN_SEANS2);

            OrderList    beklist = utl.BekleyenEmirler_Al();
            List <Order> lst     = beklist.Resultlist;

            foreach (Order a in lst)
            {
                s1 = a.Userinf;

                s2  = a.Emirtipi + "&" + Convert.ToString(a.Islemtarihi) + "&" + Convert.ToString(a.Takastarihi) + "&" + Convert.ToString(a.Referansid) + "&";
                s2 += a.Menkul + "&" + a.Fin_inst_id + "&" + a.Alsat + "&" + a.Hesapno + "&" + a.Custid + "&" + a.Accid + "&";
                s2 += Convert.ToString(a.Lot) + "&" + Convert.ToString(a.Maxlot) + "&" + Convert.ToString(a.Marjyuzde) + "&";
                s2 += Convert.ToString(a.Tetiksaat) + "&" + Convert.ToString(a.Tetikdakika) + "&" + Convert.ToString(a.Tetiksaniye) + "&" + IslemTipi + "&";
                s2 += Convert.ToString(a.Gib_yuzde1) + "&" + Convert.ToString(a.Gib_yuzde2) + "&" + Convert.ToString(a.Gib_baszmn1) + "&" + Convert.ToString(a.Gib_baszmn2) + "&" + Convert.ToString(a.Gib_baszmn3) + "&" + Convert.ToString(a.Gib_bitzmn1) + "&" + Convert.ToString(a.Gib_bitzmn2) + "&" + Convert.ToString(a.Gib_bitzmn3) + "&" + Convert.ToString(a.Gib_parcasayisi) + "&" + Convert.ToString(a.Gib_enson_aktifOlanParca) + "&" + Convert.ToString(a.Aktiflesme_sekli) + "&" + Convert.ToString(a.Hesaplananagirlikliortalamafiyati);

                str_tut = s1 + "|" + s2 + "%";

                ThreadOrdino thr    = new ThreadOrdino(str_tut, dosyayayaz);
                Thread       thread = new Thread(new ThreadStart(thr.islem));
                thread.Start();
                // System.Threading.Thread.Sleep(200); //* Bekle.
            }
        }
Exemplo n.º 2
0
        //****************************************************************************************************************

        public void Kapanista_BekleyenEmirleri_Aktive_Et()   //*17:29:00 da bekleyen tüm emirleri gönder.
        {
            ThreadOrdino thr    = new ThreadOrdino();
            Thread       thread = new Thread(new ThreadStart(thr.islem2));

            thread.Start();
        }
Exemplo n.º 3
0
        //****************************************************************************************************************

        private void clientMesajDinle(IAsyncResult res)
        {
            Socket      scr = (Socket)res.AsyncState;
            SocketError errm;
            int         bytesRead2 = scr.EndReceive(res, out errm);
            bool        dosyayayaz = true;

            if (SocketError.Success == errm)
            {
                string gelen = Encoding.Default.GetString(buffer2, 0, bytesRead2);
                Array.Clear(buffer2, 0, buffer2.Length);
                System.Threading.Thread.Sleep(200);       //* Bekle.
                string str_tut = "";
                int    pos     = gelen.IndexOf("%");

                while (pos > 0)
                {
                    str_tut = gelen.Substring(0, pos);
                    if (str_tut == "KAP")
                    {
                        try
                        {
                            AllClientSockets.Remove(scr);
                            break;
                        }
                        catch (NullReferenceException nexp) { }
                    }
                    else
                    {
                        if (str_tut != "HBT")
                        {
                            ThreadOrdino thr    = new ThreadOrdino(str_tut, dosyayayaz);
                            Thread       thread = new Thread(new ThreadStart(thr.islem));
                            thread.Start();
                            gelen = gelen.Substring(pos + 1, gelen.Length - (pos + 1)).Trim();
                            pos   = gelen.IndexOf("%");
                            System.Threading.Thread.Sleep(150);     //* Bekle.
                        }
                        else
                        {
                            pos = -1;
                        }
                    }
                }
            }

            try
            {
                scr.BeginReceive(buffer2, 0, buffer2.Length, SocketFlags.None, new AsyncCallback(clientMesajDinle), scr);
            }  catch (SocketException sexp)
            {
                int dummy = 1;
            }
        }