Page 3 of 4
Re: creating a socket to connect to existing servers
Posted: Fri Nov 12, 2010 10:20 am
by maverickalex
The 100miliseconds wait was already in the script, so i left it in. just for my info, in the example previous the sockets are defined as pSocket and Ssocket. Are these general names or Peer and Server socket? or just general names given to a socket.
Re: creating a socket to connect to existing servers
Posted: Sat Nov 13, 2010 12:26 am
by Mark
maverickalex,
sSocket is just a pointer to the items in the list 'the openSockets'. I don't know why someone decided to give it the prefix 's'. The p in pSocket stands for "parameter".
Kind regards,
Mark
Re: creating a socket to connect to existing servers
Posted: Sat Nov 13, 2010 8:59 pm
by maverickalex
when i run the socket i get "failed to load tree" error in messge box?
Re: creating a socket to connect to existing servers
Posted: Sat Nov 13, 2010 11:05 pm
by Mark
maverickalex,
Do you have more information?
Kind regards,
Mark
Re: creating a socket to connect to existing servers
Posted: Sat Nov 27, 2010 8:24 pm
by maverickalex
Just that really, when i run the ap i see it connect but don't know how to grab the data and obtain the info i need
Re: creating a socket to connect to existing servers
Posted: Sun Nov 28, 2010 2:26 am
by Mark
Dear maverickalex,
I'd be happy to help you, but you really need to provide more info.
For example, I should not have to ask you whether the gotPacket handler actually runs and, if it does, you should post (part of) the log here. Don't make me ask for everything, I don't have the time for that.
Best regards,
Mark
Re: creating a socket to connect to existing servers
Posted: Mon Nov 29, 2010 4:55 pm
by maverickalex
i dont get anything, only error message "tree not made"
Re: creating a socket to connect to existing servers
Posted: Mon Nov 29, 2010 5:13 pm
by Mark
Mav
and can't you explain how you get this error, where you see this exactly, when, which script, which variable, whatever?
I'm losing my patience with you. I don't feel much like helping you anymore.
Mark
Re: creating a socket to connect to existing servers
Posted: Mon Nov 29, 2010 6:09 pm
by maverickalex
I apologise, i learn much faster when following an example ans seeing it brought to life in front of me.
You said earlier you knew exactly what i wanted and how to do it?
If you could show me what i needed then i could see where i have been going wrong. This makes it easier to learn.
Re: creating a socket to connect to existing servers
Posted: Mon Nov 29, 2010 6:40 pm
by Mark
mav,
It is simple. If you have the patience to answer my questions, then you will get somewhere, you will learn someting, and next time you can do it on your own. If you refuse to answer my questions, then I won't help you.
Yes, I could do all of this on my own, but I have a programming company and am on this forum just to help out people rather than doing their projects for them.
Kind regards,
Mark
Re: creating a socket to connect to existing servers
Posted: Mon Nov 29, 2010 8:56 pm
by maverickalex
Its a question of understanding the questions you pose and then finding where the answers lie.
Re: creating a socket to connect to existing servers
Posted: Mon Nov 29, 2010 9:38 pm
by Mark
Mav,
My questions are easy. I've done this for 20+ years. I know how this works, step by step. If you don't understand my questions, then show some effort and study until you understand them.
I won't be answering this thread anymore, unless you read back and provide the information I need to help you.
Kind regards,
Mark
Re: creating a socket to connect to existing servers
Posted: Tue Nov 30, 2010 1:40 pm
by maverickalex
deleted!
Re: creating a socket to connect to existing servers
Posted: Sun Dec 05, 2010 10:33 am
by maverickalex
Mark wrote:Hi Alex,
First, you need to get the documentation of those servers. You need to know the exact protocol.
A protocol contains port information, commands to tell the server that your client software is genuine, more commands to communicate with the server and the complete specifications of the (xml) data.
As long as you don't have that, don't try it.
Best regards
Mark
I have successfully used Putty a free telnet client to connect to flightgear
i used the "get" command.
i need to scrap all the attempted starts i made and try again.
At least i know from this test that the FG internal server is working and does indeed send the correct info. I just need to sort out doing it in Rev now!
Re: creating a socket to connect to existing servers
Posted: Mon Dec 06, 2010 7:28 am
by maverickalex
i have started again. at the moment i have one connect button and on field. "callsign"
can you tell me am i now on the right track.
Code: Select all
on mouseUp
if the label of me = "connect" then
set the label of me to "disconnect"
startconnection
end if
end mouseUp
on startconnection
open socket to "127.0.0.1:5501" with message connected
end startconnection
on connected theSocket
put "data" & return & "data" & return & "get sim/multiplay/callsign" & return into mess
write mess to Socket theSocket until crlf
read from socket theSocket until return with message "callsignResult"
end connected
on callsignResult theSocket theMessage
put theMessage into field "callsign"
end callsignResult
Thanks
Alex