B4J Question Simple TCP communication

Discussion in 'B4J Questions' started by hakha4, Apr 28, 2015.

  1. hakha4

    hakha4 Member Licensed User

    Hi. Kind of a newbie and need some advise. My aim is to launch a non gui B4J app from a Windows script with data to be sent to a Raspberry PI trough TCP. I've finished the Raspberry Pi part in Gambas and this work ok. I've read tutorials for non gui app but I am uncertain how to implement TCP part. It is important that it is relaible. Can anyone give me a hint or even better a basic code example to start with. I haven't found any examples that address my issue.
    Regards Håkan
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is exactly the same as in Android or in a UI app. You need to use jNetwork library with AsyncStreams.

    Make sure to call StartMessageLoop to avoid the program from exiting.
     
  3. hakha4

    hakha4 Member Licensed User

    Thank's for reply. Managed to get a working app with just a few lines:)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice