Mintoris Forum

Author Topic: TCP Diagnostics Demo  (Read 2860 times)

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
TCP Diagnostics Demo
« on: May 28, 2014, 12:01 AM »
Attached below is the TCP Diagnostics program I used while developing TCP communications. Since there is no way to broadcast across TCP, you have to know the address and port you want to communicate with.

ServerIP$ = "192.168.0.103"

Change this line to the IP address of one of your test devices and use that device as the server. The diagnostics program displays the IP address when it starts.

Once connected a simple loopback test is run.
« Last Edit: May 31, 2014, 04:17 AM by Chuck »

Egil

  • Jr. Member
  • **
  • Posts: 2
Re: TCP Diagnostics Demo
« Reply #1 on: Feb 08, 2017, 09:14 AM »
I know this is a very old thread, but when reading this statement I just had to post a comment:
Quote
Since there is no way to broadcast across TCP…


Programming TCP/IP for Android should be the same as for Windows.

So if you change the statement ServerIP$ = "192.168.0.103" to ServerIP$ = "192.168.0.255", all devices listening  to the port specified will receive the message. So select the port carefully to avoid choosing one that is already used by another application.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: TCP Diagnostics Demo
« Reply #2 on: Feb 08, 2017, 05:00 PM »
Yes, but the devices have to be listening in the first place to get the tcp message. How does your phone get the ip address of the listener without the user typing in the address?