B4J Question Filesize of incoming data

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I know I asked this question once before (some time ago) but now I can't find the thread I posted and searched the forum for it, and can't remember the answer to the question..

I have a B4J app that is listening on a port and allows B4A, B4i apps to connect and send ASCII messages to this B4J app.

Let's say the B4A app sends the message hello1234 I want to then log the incoming data size in my B4J app. For Example 100 bytes, 100kb, 1MB etc. Then when the next message comes in then add to this file size.
 

aaronk

Well-Known Member
Licensed User
Longtime User
Sorry, should of said..

I am doing this with ServerSocket with AsyncStream.
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
This is a mistake. You should use one of the other more powerful solutions
Yeah, I am planning on using websockets in the future but just looking at using serversockets for now. Then I plan on looking into MQTT and learning on how it works but need to look into that.

So just confirming if I get a message test1234 then it should log 8, which would mean it just received 8 bytes?
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
Is there a way to receive the file size of the MQTT ?

Looking though the mosquito documentation it says:


I tried subscribing to $SYS/broker/bytes/received but it retuned nothing.

Am I doing something wrong, or is there another way in doing it ?
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
So there is no way in finding out how many messages, or how much data has been sent throughout the MQTT broker ?

The only way I guess in finding out is getting the B4J Client MQTT to subscribe to each topic so it can see all messages being sent.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…