Android Question Socket Send Bytes Array

Peppe B

Active Member
Licensed User
How to represent the? CChar(vbNullChar)

The logic is to send the lenght size of the bytes, then "CChar(vbNullChar)" and send the all bytes in an array.

How to do this with b4a?
 
Last edited:

techknight

Well-Known Member
Licensed User
Longtime User
All CChar does is return the first character of a given expression. Thats it. So CChar prints the character representation of vbNullChar.

Youll probably need byteconverter library and use the ASCII code for Null. However, vbNullChar is just a 0. or ASCII 0x00, so equivalently, your returning the print character of the value 0. in the case of B4X, that would be Chr(0)

when designing/using protocols like this, you really need to understand on a binary level what is going on, which will help you at porting code between languages.
 
Last edited:
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Again, you need to study the protocol or know the protocol.

If you log the raw binary output as a hex-string from your VB.Net program, and then compare it against the binary hex-string output from the B4A program, then it will become apparent where the problem is.

I cannot help you further, and I dont think anyone else can either without knowing the full scope of the project, the expected input, and the expected output.

Sorry.
 
Upvote 0

Peppe B

Active Member
Licensed User
I just need to send an array of bytes, I tried OutputStream

But I did not succeed.

Leave novalmente for what?
 
Last edited:
Upvote 0
Top