This thread is for questions for the tutorial "The basics of connecting one server to another for FMS".
http://www.fmsguru.com/showtutorial.cfm?tutorialID=45
* Last updated by: Graeme on 1/9/2011 @ 5:01 AM *
1
Created on: 01/09/11 04:55 AM
Replies: 16
Graeme
Joined: 10/18/07
Posts: 1568
The basics of connecting one server to another
01/09/11 4:55 AM
This thread is for questions for the tutorial "The basics of connecting one server to another for FMS".
http://www.fmsguru.com/showtutorial.cfm?tutorialID=45
* Last updated by: Graeme on 1/9/2011 @ 5:01 AM *
iforsyth
Joined: 01/25/11
Posts: 7
Having a server act as a client
01/25/11 4:22 AM
This might sound a little stupid, but I know that calling a function on server 2 was covered in the tutorial, but as I understand it, server 1 is now a client of server 2. If that's true, I'd like to be able to call a function on server one from server 2 (i.e. the other way round from the tutorial) and was wondering how different it would be?
EDIT: Just to clarify, I mean having the first server run code the way you would if it was a client (nc.client.functionName = function()) because I'm stumped.
* Last updated by: iforsyth on 1/26/2011 @ 7:53 AM *
Graeme
Joined: 10/18/07
Posts: 1568
RE: The basics of connecting one server to another for FMS
01/28/11 8:45 PM
Server 1 becomes a client of server 2, keep track of that client object and then call functions with the call() method. Declare those on server 1 in either the Client.prototype or client object as they connect up. Should be good to go.
iforsyth
Joined: 01/25/11
Posts: 7
RE: The basics of connecting one server to another for FMS
02/04/11 2:02 AM
Thanks for the help Graeme, now I have another question.
We have one server that should connect to another server, and that works fine when I test locally, all the connections go through, all the code is run correctly. When the applications are placed on the server, however, the connection no longer goes through. The connection address is correct as it is possible to connect to the second server from other sources with the same address. The applications sit alongside each other on the server.
I was just wondering if you've got any ideas about what may be stopping the connection from going through?
Graeme
Joined: 10/18/07
Posts: 1568
RE: The basics of connecting one server to another for FMS
02/05/11 3:12 PM
I suspect it's a case issue. Like you are trying to connect to "myApp" and you are specifying "myapp". Just a thought. It's amazing how such a trivial item can catch you up and it looks the same otherwise. Give that a try, let me know.
iforsyth
Joined: 01/25/11
Posts: 7
Graeme
Joined: 10/18/07
Posts: 1568
iforsyth
Joined: 01/25/11
Posts: 7
RE:
02/06/11 3:20 PM
Sorry for the misunderstanding there Graeme, that could possibly be the issue, I'll test it in the morning to be sure though, thanks so much. One other question though: If the server apps reside on the same physical server, that should be ok, right?
EDIT: Just so you can see what I'm trying to do I'll include the basic code for connecting
SERVER 1:
SERVER 2:
1
and I'm getting a NetConnection.Connect.Rejected message
* Last updated by: iforsyth on 2/8/2011 @ 3:38 AM *
Graeme
Joined: 10/18/07
Posts: 1568
iforsyth
Joined: 01/25/11
Posts: 7
Graeme
Joined: 10/18/07
Posts: 1568
iforsyth
Joined: 01/25/11
Posts: 7
Graeme
Joined: 10/18/07
Posts: 1568
iforsyth
Joined: 01/25/11
Posts: 7
RE: The basics of connecting one server to another for FMS
02/22/11 3:48 AM
Yeah you could, that was the strange thing. I got it working though, and here's the working code:
1
I think it was something to do with the instance names themselves. It didn't want to hook them up if one of them was using the default instance. Thanks for all your help Graeme.
Graeme
Joined: 10/18/07
Posts: 1568
e1
Joined: 03/10/11
Posts: 12
RE: The basics of connecting one server to another for FMS
04/28/11 3:52 AM
I have managed to connect using this example. Thank you.
Is it possible to connect each new user same way?
I have tryed using this code in application.onConnect instead of application.onAppStart but I am getting nothing. Not even startup traces.
Anyone please ?
kjeske
Joined: 04/04/09
Posts: 26
RE: The basics of connecting one server to another for FMS
03/26/12 5:05 PM
Okay so i understand the concept of talking between applications/servers.
But i dont see how this is useful for true load balancing or routing requests.
For example.. say i'm building a chat application.
I have multiple chat rooms that i want people from chat room 1 to be able to talk to chat room 2 if they need to.
So i have a master host chat app that runs and manages whos in what room etc.
Then i have each room connect to that master chat host.
When user 1 from room 1 tries to talk to user 2 in room 2 they ask the host what room that person is in and then the host returns the room.
they problem is that this happens asynchronous from the actual context of the code..
take a look at this code:
If anyone has any suggestions for how to approach this this me know!
1
New Post
Please login to post a response.