Jump to content

Recommended Posts

Posted

Hi
send structure to the server in c ++
how do you translate that into autoit?
who can help?

 

typedef struct _PAKET_DATA{
    int32_t command;
    int32_t dsize;
    int32_t op_1;
    int32_t op_2;
    int32_t op_3;
}PAKET_DATA, *pPACKET_INFO;



bool netSend(int socket, int32_t command, char* p_data, int32_t data_size, int32_t opt)
{
    PAKET_DATA paket;
    ssize_t bytes;

    if ((p_data) && (data_size == 0))
        { data_size = (int32_t)strlen(p_data) + 3; }

    paket.command   = command;
    paket.data_size = data_size;
    paket.optional  = opt;
    bytes = send(socket, (char*)&paket, sizeof(PAKET_INFO), 0);
    if ((p_data) && (paket.data_size))
        { bytes = send(socket, p_data, paket.data_size, 0); }

    return true;
}
   
    
    
    
    

 

 

 

 

 

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...