Beispiel #1
0
        private bool DataFromServerToClient(CAsyncServiceHandler sender, ushort reqId, CUQueue qData)
        {
            bool processed = false;

            switch (reqId)
            {
            case CStreamSerializationHelper.idReadDataFromServerToClient:
                if (qData.GetSize() > 0)
                {
                    lock (m_cs)
                    {
                        CStreamSerializationHelper.Write(m_s, qData);
                        if (Progress != null)
                        {
                            Progress.Invoke(this, (ulong)m_s.Position);
                        }
                    }
                    qData.SetSize(0);
                    processed = true;
                }
                break;

            default:
                break;
            }
            return(processed);
        }
Beispiel #2
0
 /// <summary>
 /// Write data from client to this server
 /// </summary>
 /// <param name="q">A memory queue containing data from a client</param>
 /// <param name="receiver">A stream at server side to receive data from a client</param>
 public static void WriteDataFromClientToServer(CUQueue q, Stream receiver)
 {
     CStreamSerializationHelper.Write(receiver, q);
 }