Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 06:29
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Flash Remoting with AMF (Moderators: Flash-db, Musicman, Jorge Solis, papachan, nothingGrinder)
| | |-+  is AMF can be used as protocol for gaming server
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Print
Author Topic: is AMF can be used as protocol for gaming server  (Read 7109 times)
umen
Server what's that
*
Posts: 18


View Profile
« on: 01/06/09, 04:45 »

Hello all
im total newbie in flash/Action script but have many years of experience in c++/java and im trying to learn as much as i can on the subject
mainly on the communications / sockets components it have . so i know flash have protocol that support distributing objects on top of http/https .
my main question is does this protocol can be used as the protocol to multi user game server between flash player client and c++ server ?
or should i implement this with simple http protocol , what usually servers like this are using ?
Thanks
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #1 on: 01/06/09, 06:18 »

Flash connects to a socket server using XMLSocket (that means passing plain text trough the wire) and there are a few servers writed for this, mainly writed in Java (see http://www.flash-db.com/Board/index.php?topic=3509.0 )
amf is a protocol for the data layer and allow to pass binary data back and forth

Jorge
Logged

Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #2 on: 01/06/09, 06:51 »

If you need socket connection with push functionality, you need a socket server.
AMFPHP is great for client triggered asynchronous communication with structured data.
To releave the stress from a socket server, you could write your applications to use the socket only for timing relevant actions, but the AMFPHP for larger structured data.
Logged

happy flashing
Cool
Ronald
umen
Server what's that
*
Posts: 18


View Profile
« Reply #3 on: 01/06/09, 07:24 »

Thanks allot , i am looking for way to implement (like) persistent
connections using http protocol ( like rest oe comet )
is there something like this ?
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #4 on: 01/06/09, 07:40 »

Not really familiar with persistent connections trough http, but I think Flash expect a socket and messages trough it. Try using XMLSocket on the port where you build your http thing

Jorge
Logged

umen
Server what's that
*
Posts: 18


View Profile
« Reply #5 on: 01/06/09, 08:27 »

so if i understand it the AMF is data layer on top of the XMLsocket ?
what os faster to use plain xml or amf3?
just to be sure .. i know i read this in the manuals but using AMF3 or XMLsocket
is wrapper on top of http protocol ?
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #6 on: 01/06/09, 08:33 »

ActionScript Message Format is a data only transportation layer, and works in conjunction with Flash Remoting to transfer binary data over HTTP in an asyncronous way
In the other hand, XMLSocket is an ActionScript class that allows to transfer plain text (XML or whatever other text) over a socket. In AS3 you can push binary data (integer, double, chars, etc) directly into a Socket class.
By any means amf is not a communication protocol but a data transportation protocol

Jorge
Logged

umen
Server what's that
*
Posts: 18


View Profile
« Reply #7 on: 01/06/09, 09:53 »

Thanks very much for the reply's
does flash player has more options to connect over http ?
what about the video streaming what they use ?
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #8 on: 01/06/09, 09:55 »

Video and audio streaming use rtmp (Real Time Message Protocol) and is implemented by servers like Flash Media Server or Red 5.

Jorge
Logged

umen
Server what's that
*
Posts: 18


View Profile
« Reply #9 on: 01/06/09, 10:22 »

ok ok now im confused bit from all of the ways to communicate with
im reading in the ActionScript 3.0 Language and Components Reference
about XMLSocket and it says that it used for sending xml text over http
only on ports greater than or equal to 1024 but its a problem when i like
to use the default port 80 (web ) . so this is problem number 1
problem number 2 is what about synchronous communication does  XMLSocket 
support it ? i can't find it in the docs.

now if i do make async application over http what will be better for me ?
in terms of saving requests sizes plain XMLSocket or to use AMF ?
« Last Edit: 01/06/09, 10:26 by umen » Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #10 on: 01/06/09, 12:06 »

Even though AMFPHP fires events, it is run as pull interface only.
A socket keeps connection and server sends packages, even when the client does not ask for them (push).
So we are talking about different technologies.
I terms of size, AMF-Packages are extremely more efficient, than XML-Streams - and more directly usable (object transfer).
This is, why a socket server needs a socket port - and usualy cannot run under port 80.
The Flash client can use all of them.
Logged

happy flashing
Cool
Ronald
umen
Server what's that
*
Posts: 18


View Profile
« Reply #11 on: 01/06/09, 14:59 »

so what do i need to use to be able use port 80
that is every internet client could use ? what options does it leave me to work with ?
what usually game or chat server doing ?
Thanks allot for helping
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #12 on: 01/06/09, 15:16 »

Usually sockets use other ports and not 80. RTMP use a mode called Tunelling that allow to use RTMP encapsulated in HTTP packets trough port 80. Using ports below 1024 concern security issues and you should use a security policy (crossdomain over socket) I can't get how you use the socket trough http ... ¿using some custom protocol or ...?

Jorge
Logged

umen
Server what's that
*
Posts: 18


View Profile
« Reply #13 on: 01/06/09, 15:33 »

well in the mean while i just trying to find what options do i have with the flash client
i do have to use something that can be used throw port 80.
the application is planed to be used by internet users so i have no much choice..
how does other chat servers do it ?
 
 
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #14 on: 01/06/09, 15:42 »

Mmmm ... almost all common applications except browsers use ports different than 80, like MSN or Skype to mention just a couple. Restriction in port use are more related to companies that block ports on his intranet using firewalls to avoid employees lost time chatting with his friends.

Jorge
Logged

Pages: [1] 2 Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!