Example #1
0
		// 注销远程通道
		public int RmtDestroyChannel()

		{
			// send:long usrid
			//      long Channel
			// recv:
			// return long
	
			DTLPParam	param = new DTLPParam();
			int		lRet;
			int			nRet;
			int			nLen;
			byte [] baSendBuffer = null;
			byte []	baRecvBuffer = null;
			int			nErrorNo = 0;
	
			Debug.Assert(client != null,
				"client为空");
	
			param.Clear();
			param.ParaLong(m_lUsrID);
			param.ParaLong(m_lChannel);

			lRet = param.ParaToPackage(DtlpChannel.FUNC_DESTROYCHANNEL,
				nErrorNo,
				out baSendBuffer );

			if (lRet == -1) 
			{
				return -1; // error
			}
	
			nRet = SendTcpPackage(baSendBuffer,
                baSendBuffer.Length,
				out nErrorNo);
			if (nRet < 0) 
			{
				return -1;
			}

			nRet = RecvTcpPackage(out baRecvBuffer,
				out nLen,
				out nErrorNo);

			if (nRet<0) 
			{
				return -1;
			}
	
			param.Clear();
			param.DefPara(Param.STYLE_LONG);


			int nTempFuncNum = 0;
			param.PackageToPara(baRecvBuffer,
				ref nErrorNo,
				out nTempFuncNum);

			lRet = param.lValue(0);
	
			m_lChannel = -1;

			return lRet;
		}
Example #2
0
        // 注销远程通道
        public int RmtDestroyChannel()

        {
            // send:long usrid
            //      long Channel
            // recv:
            // return long

            DTLPParam param = new DTLPParam();
            int       lRet;
            int       nRet;
            int       nLen;

            byte [] baSendBuffer = null;
            byte [] baRecvBuffer = null;
            int     nErrorNo     = 0;

            Debug.Assert(client != null,
                         "client为空");

            param.Clear();
            param.ParaLong(m_lUsrID);
            param.ParaLong(m_lChannel);

            lRet = param.ParaToPackage(DtlpChannel.FUNC_DESTROYCHANNEL,
                                       nErrorNo,
                                       out baSendBuffer);

            if (lRet == -1)
            {
                return(-1);                // error
            }

            nRet = SendTcpPackage(baSendBuffer,
                                  baSendBuffer.Length,
                                  out nErrorNo);
            if (nRet < 0)
            {
                return(-1);
            }

            nRet = RecvTcpPackage(out baRecvBuffer,
                                  out nLen,
                                  out nErrorNo);

            if (nRet < 0)
            {
                return(-1);
            }

            param.Clear();
            param.DefPara(Param.STYLE_LONG);


            int nTempFuncNum = 0;

            param.PackageToPara(baRecvBuffer,
                                ref nErrorNo,
                                out nTempFuncNum);

            lRet = param.lValue(0);

            m_lChannel = -1;

            return(lRet);
        }