use desktop-pc as server

schimanski

Well-Known Member
Licensed User
Longtime User
Hello!

I want to use my Desktop-PC as server, to send an NMEA-protocol every two seconds in the internet. After that, I want to use my pockt-pc as client to read this nmea over a gprs-connection. Do I have to use a special serversoftware to manage the ports or what do I have to do? I have no eperience with serverapplications. With the following code, I get the IP from my deskop-pc to connect the client, but then, I flounder.


Code Server:

(NMEA_RMC and NMEA_GGA are NMEA-Strings)

B4X:
'Button <server connect>'
Sub Button1_Click
   server.New1(55355)
   server.Start
   client.New1 
   IP_Server=client.GetIP2(server.HostName)
End Sub

'Button <send NMEA>'
Sub Button2_Click
             stream.New1(client.GetStream, False)
             timer1.Interval=2000
             timer1.enabled=true
End Sub

Sub Timer1_Tick
   stream.WriteString(NMEA_RMC & NMEA_GGA & CRLF)
End Sub


The clientsoftware is correct, I have tested it on a real server..

thanks for help
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is not simple.
If your computer is connected to the internet with a router then its IP is not a "real" global IP. Also the IP usually changes from time to time by the ISP.
If your computer is equipped with a firewall you should also configure the firewall to allow the incoming connection.

Note that I'm not a network expert.
 

schimanski

Well-Known Member
Licensed User
Longtime User
Only a test-application

Hello Erel, thanks for answer.

I dont' want to create a perfect server-application. I only want to send a nmea-protocol in a smal testversion, to check my client-software, when the main server is not available. That I get every time another IP is also no problem. I take this with GetIP an set it to the client.
But is there more nessesary than a server-application in basic4ppc for this simple tool? Must I have software like apache or a specal harware? I don't know. The only thing I know is, that the code above doesn't send a nmea-protocol in the internet. :sign0148:


many greetings.....
 

schimanski

Well-Known Member
Licensed User
Longtime User
Only check my new User CP

Hello!

No questions!!!!

I only wanted to check my new User CP.

:)
 
Top