Command that send Bulk Of commands

Jan 7, 2013 at 9:23 AM
Edited Jan 7, 2013 at 9:25 AM

Hi,  I'm using Super Web Socket for a while, it is great, all work, I can send commands and no issues.Now I'm tring to send bulk of commands inside one command, I saw that if I send lots of small commands the websocketStart work verrrrry slow, so I come out with new command to collect few commands and send them in one shot.I'm dealing with serialize issue, whould be glad if you help me.My command will send the BulkCMD_Structure to client.I get only CommandID in the array :(

    #region BulkCommand
    [Serializable]
    public class BulkCMD_Structure
    {
        public Int64 UserID { get; set; }
        public int DataArrayLength { get; set; }
        public List<BulkCMD_Data> DataArray;
    }

    [Serializable]
    public class BulkCMD_Data
    {
        public eWebSocketCMD CommandID { get; set; }
    }
    [Serializable]
    public class BulkWindowCMD_Data : BulkCMD_Data
    {
        public int X { get; set; }
        public int Y { get; set; }
        public int Width { get; set; }
        public int Height { get; set; }
        public byte[] Image { get; set; }
    }
  
    [Serializable]
    public class BulkMouseStatusCMD_Data : BulkCMD_Data
    {
        public int mousePositionX { get; set; }
        public int mousePositionY { get; set; }
    }
    #endregion

I also tried the following, but get serialization ERROR:

   #region BulkCommand
    [Serializable]
    public class BulkCMD_Structure
    {
        public Int64 UserID { get; set; }
        public int DataArrayLength { get; set; }
        public iBulkCMD_Data [] DataArray;
    }

    [Serializable]
    public class iBulkCMD_Data
    {
        eWebSocketCMD CommandID { get; set; }
    }
    [Serializable]
    public class BulkWindowCMD_Data : iBulkCMD_Data
    {
        public eWebSocketCMD CommandID { get; set; }
        public int X { get; set; }
        public int Y { get; set; }
        public int Width { get; set; }
        public int Height { get; set; }
        public byte[] Image { get; set; }
    }
  
    [Serializable]
    public class BulkMouseStatusCMD_Data : iBulkCMD_Data
    {
        public eWebSocketCMD CommandID { get; set; }
        public int mousePositionX { get; set; }
        public int mousePositionY { get; set; }
    }
    #endregion



Pls help!

 

Jan 7, 2013 at 9:54 AM

Simply changed the:

 iBulkCMD_Data [] DataArray or

List<BulkCMD_Data> DataArray

to object [] DataArray

Coordinator
Jan 15, 2013 at 10:02 AM

Can you merge so many response into one? You can define a global class to store all the information you want to send to client.

Jan 15, 2013 at 10:26 AM

No no, I don't need to manage more than one response, It is one command (its data include more than one commands (no relation to web socket commands) ), one respond .

BulkCommand with BulkCommandRespond