FearL0rd
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2012
08:42 PM
authentication using sockets
I have a code in C that send a structure pointer with user and password thought sockets and receives a message.
How do I send a structure similar to the server using sockets for authentication?
is there any way to do the same using roByteArray?
struct Message
{
uint16_t User;
uint16_t Pass;
uint16_t msg;
}
Send(socks, &message)
How do I send a structure similar to the server using sockets for authentication?
is there any way to do the same using roByteArray?
struct Message
{
uint16_t User;
uint16_t Pass;
uint16_t msg;
}
Send(socks, &message)
5 REPLIES 5

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2012
12:18 PM
Re: authentication using sockets
I asked the engineer who developed some of the Sockets functions for Brightscript, he said:
- Joel
The send() operation can take arbitrary byte data in the byte array. The script is responsible for serialization of higher level types and data structures (including accounting for size, alignment, and endian-ness) into a byte array in a manner that can be understood by the recipient. The script would have to decompose the struct values into bytes using numeric operations and then place them into the byte array using SetEntry(). The endian-ness can be tested with IsLittleEndianCPU().
- Joel
FearL0rd
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2012
02:16 PM
Re: authentication using sockets
Thank YOU
FearL0rd
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2012
02:17 PM
Re: authentication using sockets
"RokuJoel" wrote:
I asked the engineer who developed some of the Sockets functions for Brightscript, he said:The send() operation can take arbitrary byte data in the byte array. The script is responsible for serialization of higher level types and data structures (including accounting for size, alignment, and endian-ness) into a byte array in a manner that can be understood by the recipient. The script would have to decompose the struct values into bytes using numeric operations and then place them into the byte array using SetEntry(). The endian-ness can be tested with IsLittleEndianCPU().
- Joel
Joel,
Thank you!!!!!! Now I have one idea how to do it.
I can't find any example of SetEntry.
Could you please ask him if he can send you an example?
Regards,
FearL0rd

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2012
02:25 PM
Re: authentication using sockets
FearL0rd
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2012
02:27 PM