Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7966671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:29:26+00:00 2026-06-04T06:29:26+00:00

I am working an Client/Server application my client is Flash, and server is C#.

  • 0

I am working an Client/Server application my client is Flash, and server is C#.

I am connected to server and send first data and no problems so far, but when i sending the second data, its not send any data, there is no action. What can I do to solve this problem?

Server :

private void OnDataReceived(IAsyncResult asyn)
    {
        OyuncuSoketi socketData = (OyuncuSoketi)asyn.AsyncState;

        int iRx = 0;
        // Complete the BeginReceive() asynchronous call by EndReceive() method
        // which will return the number of characters written to the stream 
        // by the client
        iRx = socketData.m_currentSocket.EndReceive(asyn);
        char[] chars = new char[iRx + 1];
        System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
        int charLen = d.GetChars(socketData.dataBuffer, 0, iRx, chars, 0);
        String data = new String(chars);
        if (data.IndexOf("policy-file-request") != -1)
        {
            LST_LOG.Items.Add(" Flash Player Policy File İstendi");
            LST_LOG.Items.Add(" Policy File Gönderiliyor");
            try
            {
                Policyfilegonder(socketData.m_currentSocket);
                LST_LOG.Items.Add(" Policy File Gönderildi");
                LST_LOG.Items.Add("Oyuncu Baglandi " + DateTime.Now.ToString());
            }
            catch
            {
                LST_LOG.Items.Add(" !!!Policy File Gönderilemedi!!!");
                LST_LOG.Items.Add(" !!!Oyuncu Baglantisi basarisiz!!! " +            DateTime.Now.ToString());
            }
        }
        else
        {
            string[] gelen_bilgi;
            data.Replace("\0", "");
            gelen_bilgi = data.Split('_');
            switch (gelen_bilgi[0])
            {
                case "\0": LST_LOG.Items.Add("Oyuncu Baglantısı koptu" + DateTime.Now.ToString());
                    break;
                case "OYUNAGIRIS": socketData.Id = Convert.ToInt32(gelen_bilgi[1]); SocketList.Add(socketData); LST_LOG.Items.Add("Oyuna Giris"); socketData.m_currentSocket.Send(System.Text.Encoding.Default.GetBytes("Kabul\0"));
                    break;
                case "ODAYAGIRIS": socketData.Oda = Convert.ToInt32(gelen_bilgi[1]); 
                                   LST_LOG.Items.Add("Oyuncu " + Convert.ToInt32(gelen_bilgi[1]) + " Nolu Odaya Girdi");
                    break;
                case "ODADANCIKIS": LST_LOG.Items.Add("Oyuncu " + Convert.ToInt32(socketData.Oda) + " Nolu Odadan Çıktı"); 
                                    socketData.Oda = -1; 
                    break;
                case "SALONAGIRIS": MessageBox.Show("Salona Girildi");
                                    //socketData.Salon = Convert.ToInt32(gelen_bilgi[1]);
                                   // LST_LOG.Items.Add("Oyuncu " + Convert.ToInt32(gelen_bilgi[1]) + " Nolu Salona Girdi");
                    break;
                case "SALONDANCIKIS": LST_LOG.Items.Add("Oyuncu " + Convert.ToInt32(socketData.Salon) + " Nolu Salondan Çıktı");
                                      socketData.Salon = -1;
                    break;
                default:
                    break;
            }
        }
    }

    private void WaitForData(Socket soc)
    {

        if (pfnWorkerCallBack == null)
        {
            // Specify the call back function which is to be 
            // invoked when there is any write activity by the 
            // connected client
            pfnWorkerCallBack = new AsyncCallback(OnDataReceived);
        }

        OyuncuSoketi packet = new OyuncuSoketi();
        packet.m_currentSocket = soc;
        // Start receiving any data written by the connected client
        // asynchronously
        soc.BeginReceive(packet.dataBuffer, 0, packet.dataBuffer.Length, SocketFlags.None, pfnWorkerCallBack, packet);

    }

Client:

        private function onConnect(e:Event){
          if(fl_socket.connected){
            durum_bilgisi.text = "Sunucuya Baglanildi " + e;
            fl_socket.writeMultiByte("OYUNAGIRIS_"+FBuid.toString()+"_"+String.fromCharCode(0),"UTF8");
 //This data is sending to server by the client
            fl_socket.flush();
            }else{
            durum_bilgisi.text = "Baglantida Hata olustu " + e ;
          } 
      }

//

    private function salonaGir(e:ListEvent):void{

        var o:Object = e.item;
        girilenSalon = o.No;
        girilenSalon--;
        fl_socket.writeMultiByte("SALONAGIRIS_"+girilenSalon.toString()+"_"+FBuid.toString()+"_"+String.fromCharCode(0),"UTF8"); // but this data is not sent :(
        fl_socket.flush();
        gotoAndStop(2);
        OdalariGetir();
    }//salonaGir Sonu

socket connection is still connected, its not disconnected but its not send and data to server

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:29:28+00:00Added an answer on June 4, 2026 at 6:29 am
    NetworkStream ns = clientTCP.GetStream();
    StreamWriter sw = new StreamWriter(ns);
    sw.WriteLine("<cross-domain-policy><allow-access-from domain=\"*\" to-ports=\"*\"/></cross-domain-policy>\0");
    sw.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on Client Server application where I need to send 6 byte
I'm working on client/server application which uses AsyncSocket. For transferring data, it uses NSData
I have a client / server application made with C#. Its working fine when
Im working on a Client/server chat application which allows user to send files (images
I'm working on a client-server application (.NET 4, WCF) that must support backwards compatibility.
I'm working on a client-server Android application and trying to figure out how to
I am working on a .net rich client server application, the client call the
I have a WCF service as part of a client/server application I am working
I am working on an application where client and server share an object model,
I'm working on a client/server application in C#, and I need to get Asynchronous

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.