using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HPSocketCS.Extended
{
///
///请求数据处理类
///
[Serializable]
public class RequestData
{
public RequestData() {
}
public RequestData(int rCommand)
{
this._RequestCommand = rCommand;
}
private Int32 _RequestCommand;
///
/// 请求命令
///
public Int32 RequestCommand
{
get { return _RequestCommand; }
set { _RequestCommand = value; }
}
byte[] _AttachedData = null;
///
/// 附加数据
///
public byte[] AttachedData
{
get { return _AttachedData; }
set { _AttachedData = value; }
}
string _AttachedMessage = "";
///
/// 附加消息
///
public string AttachedMessage
{
get { return _AttachedMessage; }
set { _AttachedMessage = value; }
}
///
/// 将附加数据字节娄组转为对象
///
///
///
public T AttachedDataToObject()
{
try
{
return (T)HPSocketCS.Extended.DataSetSerializerDeserialize.ObjectDeserialize(this._AttachedData);
}
catch
{
return default(T);
}
}
}
}