Sooner or later somebody will want to know how to do this. It seems to be a fairly common "What next after Hello World?" sort of project.
The attached ZIP archive has two B4J programs: SimpleServer and SimpleClient.
While there is a huge amount I have to learn yet about B4J, these seem to be working properly. That doesn't mean they're bug-free or that I haven't done some things clumsily but these ought to be useful to help others get started with TCP sockets.
As provided these use ASCII for transmission with a CR message delimiter. You could easily change them to use UTF-8 and another delimiter or a length prefix instead.
There is a ReadMe.txt in the archive and I'll try to post a screenshot here.
The attached ZIP archive has two B4J programs: SimpleServer and SimpleClient.
While there is a huge amount I have to learn yet about B4J, these seem to be working properly. That doesn't mean they're bug-free or that I haven't done some things clumsily but these ought to be useful to help others get started with TCP sockets.
As provided these use ASCII for transmission with a CR message delimiter. You could easily change them to use UTF-8 and another delimiter or a length prefix instead.
There is a ReadMe.txt in the archive and I'll try to post a screenshot here.