internal GroupDevice CreateGroup(string detail)
        {
            //配置请求包
            ServerRequestPackage reqtPkg       = new ServerRequestPackage(true);
            ICreateGroupRequest  reqtInterface = reqtPkg.Active_CreateGroupRequest();

            reqtInterface.CreateNewGroup(detail);

            BinTransferLayer   binprocessor = _mclLayerProcessor.BinTransferProcessor;
            ServerReplyPackage replyPkg     = null;

            try
            {
                replyPkg = binprocessor.SynSendMessage(reqtPkg, 100000);
            }
            catch (System.Exception ex)
            {
                //throw timeout excetion
                throw new CreateGroupExcetion(ex.ToString());
            }
            ICreateGroupReply replyInterface = replyPkg.Active_CreateGroupReply();
            bool   ret;
            string detailOrToken;

            replyInterface.CreateGroupRet(out ret, out detailOrToken);
            if (true == ret)
            {
                GroupDevice retGrop = new GroupDevice(_mclLayerProcessor);
                retGrop.Token  = detailOrToken;
                retGrop.Detail = detail;
                retGrop.Ready  = true;
                return(retGrop);
            }
            else
            {
                throw new CreateGroupExcetion(detailOrToken);
            }
        }
Example #2
0
 /// <inheritdoc />
 public Task <IChatApiResponse <ICreateGroupResponse?> > CreateGroupAsync(ICreateGroupRequest createGroup,
                                                                          IResponseSettings?responseSettings = null) =>
 _connect.PostAsync <CreateGroupResponse, ICreateGroupResponse>(Resources.CreateGroup, createGroup.Serialize(), responseSettings);
Example #3
0
 /// <inheritdoc />
 public IChatApiResponse <ICreateGroupResponse?> CreateGroup(ICreateGroupRequest createGroup, IResponseSettings?responseSettings = null) =>
 _connect.Post <CreateGroupResponse>(Resources.CreateGroup, createGroup.Serialize(), responseSettings);