Using Communication Objects > Flash Communication Server objects > Client-server object communications

 

Client-server object communications

The following "object pairs" represent the potential connections you can establish between client-side and server-side objects. For example, when a client-side NetConnection object connects to the server, a server-side Client object is created; this Client object can then call methods of its NetConnection object counterpart.

The following table shows the client-side and server-side objects that are associated with each other.

Client-side object

Corresponding server-side object

my_nc (NetConnection object)

my_client (Client object or application.clients object)

my_ns (NetStream object)

my_server_stream (Stream object)

my_so (remote shared object)

my_server_so (server-side shared object)


In the following table, the client-side calls on the left invoke the server-side calls on the right.

Client-side call

Server-side call

my_nc.connect

application.onConnect

my_nc.close

application.onDisconnect

my_nc.call("doThing", myCallbackFcn, 1, "foo")

my_client.doThing(1, "foo")

my_so.send("doThing", 1, "foo")

my_server_so.doThing(1, "foo")


In the following table, the server-side calls on the left invoke the client-side calls on the right.

Server-side call

Client-side call

my_client.call ("doThing", myCallbackFcn, 1, "foo")

my_nc.doThing (1, "foo")

my_server_stream.send ("doThing", 1, "foo")

my_ns.doThing (1, "foo")

my_server_so.send("doThing", 1, "foo")

my_so.doThing(1, "foo")