A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: XML Sockets or Comm. Server?

  1. #1
    Junior Member
    Join Date
    May 2000
    Posts
    26
    We have a web-based event announcement system that uses a Flash front-end running in a browser window to display upcoming events on large monitors attached to stand-alone machines all over campus.

    We're doing a major rewrite of the system and are considering using XML sockets to push updated event information to the machines. Right now we're just pulling the data every 5 minutes using HTTP.

    We are also purchasing the professional comm. server to enable video to be displayed on these machines.

    The question now is: should we continue our plan to push event data via sockets to the machines, or, considering that the comm. server will be in place in a few weeks, just plan on using features of the comm. server to handle all interaction (text, dynamic jpg, video) with the clients?

    If anyone can give any suggestions or direction while we're in the design phase, we would value your advice.

    Thanks,

    Gary

  2. #2
    ASR | FlashComm Ceasar Aware0's Avatar
    Join Date
    Aug 2002
    Location
    Aurora, Colorado, USA
    Posts
    110
    FlashComm
    Ups
    • Tightly integrated with Flash
    • Easy to set up
    • you already have it


    Downs
    • User limit
    • Slow
    • expensive



    XML
    Ups
    • Fast
    • cheap
    • Dunno


    Downs
    • dunno


  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    190
    If you're purchasing your a lisence you might as well use it! The FlashComm server allows one to transfer entire objects over its rttp.

    XML Sockets *may* be *slightly* quicker however it would require production of an XML Socket Server, plus a *true* socket would use it's onXML handler - whereby it is required to parse the XML which is a relatively slow process. This can be overlooked by using its onData handler.

    *However* you still are not capable of sending raw objects. I think you're much better off with the FlashComm server, its secure, allows for transfer of raw objects and streaming media, made to incorporate rooms, and easy to use (with its server-side and client-side scripts).

    Later,
    Somar!

  4. #4
    Junior Member
    Join Date
    Dec 2001
    Posts
    19
    The downside to using Flashcomms over XMLSockets is that you cannot push from the server to the client.. instead it uses a polling method...

    With XMLSocktes you can push.


    This is the same problem I am facing for a similar sort of project.. I just wish there was an (decent) API with FlashComm..

    Come on, MM make a patch to FlashComm so that you can actually push from the server to FlashComm..

  5. #5
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    Somar -
    Take a look at the packets for rtmp
    It's pretty tiny. I imagine for the most part smaller than xml, since it doesn't have the extra weight of all the tags needed for a "well formed xml doc".

    But if you're polling now only once every 5 mins from every machine, you should be able to see nice results if you poll even once a minute from a single flashcom server, probably sitting in the same room as the database server. Depending on your data structure you may even be able to setup a temp table to poll for changes.

    Psx

  6. #6
    Senior Member
    Join Date
    Apr 2001
    Posts
    190
    push... poll... huh?

    john: I'm all for the rtmp =P

  7. #7
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    I wish MM would add a "Socket" object. XMLSockets don't need XML, you can just use a simple protocol like this:

    mySock.send("Children, go to sleep");

    And to receive:

    mySock.onData = function(d){
    _root.mytext = d;
    };

    Start up the socket:

    mySock = new XMLSocket();
    mySock.connect(server, 2400);

    For the socket server, you could use the free one from Colin Moock on http://www.moock.org (CommServer)

    Very easy indeed, all pushed and no extra info. For running the server, it's just a little java program running.

    Pros: Simple, lightweight, no set up (just plug in that code and run the java server), free, fast, nice, smells good ect...

  8. #8
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    Hmmm..
    Are you saying you can do that now, or that it's something you're wishing for? Sounds awesome if it's doable now. In fact, if you can do that, why on earth do you need xml in the first place?

    Psx

    Another interesting thought.. Using FlashStudioPro (or most any of the 3rd party swf tools) you can make an exe that you can make listen on a given port for connections. I wonder if it'd be possible to build a server in flash. Note I didn't say practical

  9. #9
    Senior Member
    Join Date
    Apr 2001
    Posts
    190
    Originally posted by Ed Mack
    I wish MM would add a "Socket" object. XMLSockets don't need XML, you can just use a simple protocol like this:

    mySock.send("Children, go to sleep");

    And to receive:

    mySock.onData = function(d){
    _root.mytext = d;
    };

    Start up the socket:

    mySock = new XMLSocket();
    mySock.connect(server, 2400);

    For the socket server, you could use the free one from Colin Moock on http://www.moock.org (CommServer)

    Very easy indeed, all pushed and no extra info. For running the server, it's just a little java program running.

    Pros: Simple, lightweight, no set up (just plug in that code and run the java server), free, fast, nice, smells good ect...
    Socket = XMLSocket;
    :P

    True that though, No need for a unique onXML handler... just make a generic Socket and handle the XML through the onData function.

    However you still can't stream video/audio through it... Well maybe you could heh. I've never looked into doing mySock.send(object); what would it send? [Object object]?


    What is pushing and polling?

  10. #10
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    Somar -
    Polling is when you constantly check the server if something has changed. Similar to the way all those chat's work that use php/asp/etc.

    Pushing is when you send data to the clients from the server, without them requesting it. So when something changes in a database you can automatically notify all of your clients of that change.

    Also, apparently the push method is possible with flashcom using a java remoting server. The idea is that you fake a request coming from flashcom, and then send(push) the results. I haven't done it yet.. but when I do I'll make sure it's detailed here!

    Psx

  11. #11
    Senior Member
    Join Date
    Apr 2001
    Posts
    190
    You're telling me flash is constantly asking for updates from the FlashCom server? GAY!!!

    *back to sockets*

  12. #12
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    Haha. No! No!

    Flash is being updated by a push from the com server, just like it does from an xml server. Heck.. I even heard a rumor that the xml socket is basically wrapped in the same rtmp format, but I don't quite know what to believe as far as that one goes.

    The push vs poll stuff comes when you're dealing with flash-remoting. The push method I was talking about had to do with flash remoting and flashcom working together. It seems that out of the box, flash remoting can't push data to flashcom. But there is a workaround as I described, as vague as it may be.

    Psx

  13. #13
    Senior Member
    Join Date
    Apr 2001
    Posts
    190
    *phew*

  14. #14
    Senior Member
    Join Date
    Oct 2000
    Posts
    310
    Originally posted by Daemon_UK

    Come on, MM make a patch to FlashComm so that you can actually push from the server to FlashComm..
    that would be cool, wouldnt it? (know what i mean, knudge, knudge)...

    mike chambers

    mesh@macromedia.com

  15. #15
    Senior Member
    Join Date
    Oct 2000
    Posts
    310
    Originally posted by Aware0
    FlashComm
    Ups
    • Tightly integrated with Flash
    • Easy to set up
    • you already have it


    Downs
    • User limit
    • Slow
    • expensive



    XML
    Ups
    • Fast
    • cheap
    • Dunno


    Downs
    • dunno
    i am curious where you get that XML is faster than Flash Com. i would expect the opposit since less data is being sent, and data doesnt have to be serialized and de-serialized on the client and server.

    i would also add that in general, it is much easier / faster to develop with flash com vs XML since you are just working with native data types rather than XML.

    mike chambers

    mesh@macromedia.com

  16. #16
    Senior Member
    Join Date
    Oct 2000
    Posts
    310
    Originally posted by Somar
    You're telling me flash is constantly asking for updates from the FlashCom server? GAY!!!

    *back to sockets*
    no, they are talking about another server connecting to the flash com server, not flash talking to the flash com server.

    mike chambers

    mesh@macromedia.com

  17. #17
    Senior Member
    Join Date
    Oct 2000
    Posts
    310
    Originally posted by psychlonex
    Haha. No! No!

    Flash is being updated by a push from the com server, just like it does from an xml server. Heck.. I even heard a rumor that the xml socket is basically wrapped in the same rtmp format, but I don't quite know what to believe as far as that one goes.
    fyi, that is not true.

    mike chambers

    mesh@macromedia.com

  18. #18
    Junior Member
    Join Date
    Dec 2001
    Posts
    19
    Originally posted by MikeChambers
    that would be cool, wouldnt it? (know what i mean, knudge, knudge)...

    mike chambers

    mesh@macromedia.com
    mesh you are such a tease!

  19. #19
    Member
    Join Date
    Jul 2000
    Posts
    90
    Originally posted by Aware0
    Downs: User limit, Slow, expensive
    'user-limit'? you are talking about developer-side (licenses) aren't you?!
    Last edited by Flash Bastard; 10-23-2002 at 01:00 PM.

  20. #20
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    Just to try and set the record straight:

    Client Limit: When you buy fcs, you get either a 10-user license, or a 500-user license. If you host with Media Temple, you get users based on your chosen plan.

    So yes, this limits the number of people who can view the streamed content, or more specifically, the number of people who can connect to the flash comm. server.


    Mike - I'm guessing you mean that the xml socket doesn't use rtmp? I'm sure the fcs also probably doesn't technically use a push, but rather a persistent connection? Meaning once connected, data can travel either way through that connection.

    I guess my point was that it does the same thing as an xml socket based solution, but with a smaller packet and an easier to work with format. XML is great if you want/have to share the data with something else outside of flash (though a database does a nice job as well) but for things that are instant and then discarded, it makes sense to use something native to flash, preferably actionscript


    Finally - I agree, the push is the one thing missing I thing from the flashcom scene. An api for scripting languages, or better yet java would be awesome. A server-side loadVars would rock as well.

    Psx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center