- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The redirection library allows the developer to provide custom callbacks for communications. To do this, the library is initialized using:
IMRResult IMR_InitEx(
IMRVersion *version,
char *ini_file
SocketsCallbacks* socketsCallbacks
);
SocketsCallbacks is defined as :
typedef struct _SocketsCallbacks{
Open open_connection;
Close close_connection;
Receive receive_data;
Send send_data;
} SocketsCallbacks;
Receive is:
typedef int (*Receive)(unsigned char* buffer, unsigned int* length, unsigned int conID);
I cannot find documentation for the parameters of the this function. What I'm thinking:
1. char* buffer is a pointer to pre-allocated memory where the results of the receive will be stored
2 connId is the connection that the receive is wanting to receive data on
However, I need to know:
1. How can I tell the size of the receive buffer? It appears that length is probably an out parameter, since it is a pointer. Or maybe is it telling the size of the buffer?
2. What should the function return? Is it the number of bytes received or perhaps IMR_RES_OK (in the case of no error)
Any help would be appreciated. I apologize if I missed this somewhere in the docs.
IMRResult IMR_InitEx(
IMRVersion *version,
char *ini_file
SocketsCallbacks* socketsCallbacks
);
SocketsCallbacks is defined as :
typedef struct _SocketsCallbacks{
Open open_connection;
Close close_connection;
Receive receive_data;
Send send_data;
} SocketsCallbacks;
Receive is:
typedef int (*Receive)(unsigned char* buffer, unsigned int* length, unsigned int conID);
I cannot find documentation for the parameters of the this function. What I'm thinking:
1. char* buffer is a pointer to pre-allocated memory where the results of the receive will be stored
2 connId is the connection that the receive is wanting to receive data on
However, I need to know:
1. How can I tell the size of the receive buffer? It appears that length is probably an out parameter, since it is a pointer. Or maybe is it telling the size of the buffer?
2. What should the function return? Is it the number of bytes received or perhaps IMR_RES_OK (in the case of no error)
Any help would be appreciated. I apologize if I missed this somewhere in the docs.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Section 3.4.3.5 of the Redirection Library Design Guide (in the DOCS folder of the SDK)provides the description of this funciton.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Lance Atencio (Intel)
Hello,
Section 3.4.3.5 of the Redirection Library Design Guide (in the DOCS folder of the SDK)provides the description of this funciton.
Well, I apologize. It was right there only a couple pages up. Thanks for the help : ) Apparently length is both an in parameter and an out parameter. Interesting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - inbrian
Well, I apologize. It was right there only a couple pages up. Thanks for the help : ) Apparently length is both an in parameter and an out parameter. Interesting.
No need to apologize and you are welcome.
Yes, the input/output is used to allow the caller to indicate (input)how much buffer space is availableand get back (output)how much of it was used.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page