Computer Science Canada Looking for Turing Command to send variables to server via internet |
Author: | deltamanx [ Wed Jan 06, 2010 12:17 am ] |
Post subject: | Looking for Turing Command to send variables to server via internet |
Hello there, I'm attempting to make a code that would get the user's username and password (which I succeded at), and then send those creditentials over to a server where they could be compared with a list of account, if it exist and the username/password entered was correct to log the person into the program. The problem I'm facing is making the actual code to send the variables (username/password) over to the server, and then for the server to send a reply. If this helps; I am using turing version 4.1.1, and understand the fact that I will need to put the two parts (server and client) into two different programs. If any one could assist me, I'd be very grateful. deltamanx. |
Author: | DemonWasp [ Wed Jan 06, 2010 2:00 am ] |
Post subject: | RE:Looking for Turing Command to send variables to server via internet |
Look at the example code Turing Help on the Net module. Be forewarned: Turing is horrendously bad at networking. |
Author: | mirhagk [ Wed Jan 06, 2010 7:20 am ] |
Post subject: | RE:Looking for Turing Command to send variables to server via internet |
you can only send data over a local network, and you need the ip of the server, which may be difficult at school where the server could not stay running all the time. Personally I'd suggest just using an encrypted file and decrypt the user names and passwords to compare it. As long as you encrypt it pretty good, most people would be unable to *hack* it. |
Author: | deltamanx [ Wed Jan 06, 2010 2:22 pm ] | ||||
Post subject: | Re: Looking for Turing Command to send variables to server via internet | ||||
For those who didn't completely understand: I'm hosting the server with a turing application. I need to make a turing application that will connect to said server. Here's a bit of server code:
And my server code:
|
Author: | DemonWasp [ Wed Jan 06, 2010 2:37 pm ] | ||||
Post subject: | RE:Looking for Turing Command to send variables to server via internet | ||||
You use put to write things over network streams. This looks almost exactly like writing data to a file:
Similarly, you can use get to read from the network. This looks like:
You appear to be missing some colons. |
Author: | DtY [ Wed Jan 06, 2010 5:19 pm ] |
Post subject: | Re: RE:Looking for Turing Command to send variables to server via internet |
mirhagk @ Wed Jan 06, 2010 7:20 am wrote: you can only send data over a local network. Sending data to a remote server (ie. not on the local network) can be done exactly as it would a machine on the local network. The only difference is the IP address wouldn't be in the subnet mask (if that's the right word?). |
Author: | deltamanx [ Wed Jan 06, 2010 6:01 pm ] | ||||
Post subject: | Re: RE:Looking for Turing Command to send variables to server via internet | ||||
Yes I noticed after posting that I was using:
In stead of:
What worries me is the mention of; DtY @ Wed Jan 06, 2010 5:19 pm wrote: mirhagk @ Wed Jan 06, 2010 7:20 am wrote: you can only send data over a local network. Sending data to a remote server (ie. not on the local network) can be done exactly as it would a machine on the local network. The only difference is the IP address wouldn't be in the subnet mask (if that's the right word?).Could I simply substitute a server on a different programming language (Visual Basic, Java) or would I have to redo client as well? |
Author: | DemonWasp [ Wed Jan 06, 2010 7:15 pm ] |
Post subject: | RE:Looking for Turing Command to send variables to server via internet |
You could (theoretically; Turing may not behave perfectly and I'm too lazy to test) swap out another language for either server or client, as long as the network "language" - what you send back and forth - remains the same. One interesting thing to note is that networks may use a different endianness than the platform you're on, so you may have to correct for that. |
Author: | deltamanx [ Wed Jan 06, 2010 8:24 pm ] |
Post subject: | RE:Looking for Turing Command to send variables to server via internet |
Succes! I redid the code for the server in Visual Basic; I didn't expect it to have any affect, however, one of my friends managed to connect to the server from the client (still programmed it Turing) to the server, with little trouble. Thank you any way. |