creating a socket to connect to existing servers
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 108
- Joined: Sun Mar 15, 2009 11:51 pm
Re: creating a socket to connect to existing servers
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
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
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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 108
- Joined: Sun Mar 15, 2009 11:51 pm
Re: creating a socket to connect to existing servers
when i run the socket i get "failed to load tree" error in messge box?
Re: creating a socket to connect to existing servers
maverickalex,
Do you have more information?
Kind regards,
Mark
Do you have more information?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 108
- Joined: Sun Mar 15, 2009 11:51 pm
Re: creating a socket to connect to existing servers
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
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
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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 108
- Joined: Sun Mar 15, 2009 11:51 pm
Re: creating a socket to connect to existing servers
i dont get anything, only error message "tree not made"
Re: creating a socket to connect to existing servers
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
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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 108
- Joined: Sun Mar 15, 2009 11:51 pm
Re: creating a socket to connect to existing servers
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.
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
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
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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 108
- Joined: Sun Mar 15, 2009 11:51 pm
Re: creating a socket to connect to existing servers
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
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
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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 108
- Joined: Sun Mar 15, 2009 11:51 pm
Re: creating a socket to connect to existing servers
deleted!
Last edited by maverickalex on Sun Dec 05, 2010 10:33 am, edited 1 time in total.
-
- Posts: 108
- Joined: Sun Mar 15, 2009 11:51 pm
Re: creating a socket to connect to existing servers
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!
-
- Posts: 108
- Joined: Sun Mar 15, 2009 11:51 pm
Re: creating a socket to connect to existing servers
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.
Thanks
Alex
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
Alex