Exemplo n.º 1
0
    void ReceiveAudio(int audioSize)
    {
        COMData_audio audio = new COMData_audio();
        audio.data = new byte[audioSize];

        int sizeReceived = socket.Receive(audio.data);

        if(audioSize == sizeReceived){
            infoReceived.Enqueue(audio);

            Log.AddToDebug("Image Received: " + audio.data.Length);
        }
    }
Exemplo n.º 2
0
    bool SendAudio(COMData_audio audio)
    {
        string header =
            COMData.macroInit +
                audio.type +
                COMData.macroSeparator +
                audio.data.Length +
                COMData.macroEnd;

        Log.AddToDebug(header);
        socket.Send(System.Text.Encoding.UTF8.GetBytes (header));
        int bytesSent = socket.Send(audio.data);

        return bytesSent == audio.data.Length;
    }
    void ReceiveAudio(int audioSize)
    {
        COMData_audio audio = new COMData_audio();
        audio.data = new byte[audioSize];

        int sizeReceived = socket.Receive(audio.data);

        if(audioSize == sizeReceived){
            server.infoReceived.Enqueue(new KeyValuePair<int, COMData>(id, audio));

            Log.AddToDebug("Image Received: " + audio.data.Length);
        }
    }