Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
FearL0rd
Visitor

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)
0 Kudos
5 REPLIES 5
RokuJoel
Binge Watcher

Re: authentication using sockets

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
0 Kudos
FearL0rd
Visitor

Re: authentication using sockets

Thank YOU
0 Kudos
FearL0rd
Visitor

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
0 Kudos
RokuMarkn
Visitor

Re: authentication using sockets

0 Kudos
FearL0rd
Visitor

Re: authentication using sockets

Hi guru's

Can you help with this ?

viewtopic.php?f=34&t=51318&p=348703#p348703
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.