Exemple #1
0
    /// <summary>
    /// 发送消息给服务器
    /// </summary>
    /// <param name="netSendModel"></param>
    public override void Send(NetSendModel netSendModel)
    {
        if (isConnection == false)
        {
            Log("服务器未连接,请先连接服务器");
            return;
        }
        TSendModel sendModel  = (TSendModel)netSendModel;
        BytesUtils bytesUtils = new BytesUtils(sendModel.msgId, sendModel.array);
        var        buff       = bytesUtils.toArray();

        sendEventArg.SetBuffer(buff, 0, buff.Length);
        bool willRaiseEvent = socket.SendAsync(sendEventArg);

        if (!willRaiseEvent)
        {
            ProcessSend(sendEventArg);
        }
    }
 public virtual void Send(NetSendModel netSendModel)
 {
 }