Live Multiuser Flash with XML Socket Server
A Flash Developer Resource Site

Results 1 to 19 of 19

Thread: Live Multiuser Flash with XML Socket Server

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    8
    Hi ...

    Our group has just released a server that makes it easy to build live multiuser Flash features, like games, text and avatar chats, whiteboards, virtual classrooms, animated story environments, etc. etc. We call it “FlashNow” and it supports the XML feature in Flash 5. We've been using it for a while for various distance learning and "immersive environment" projects.

    XML provides a structure for the message, but the server will support any alphanumeric string data. (It also supports javascript, Java, and VRML applications.) There’s example code for various types of Flash projects. The server runs under Windows or Linux. A free trial version is available from http://www.nowcentral.com. A software grants program is available for non-profit and academic organizations.

    If anybody has time to try it, let us know what you think!

    ... John Reaves, Learning Worlds

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    687
    Hey what makes yours so special. I think it's a really good idea. But is it an actual server. Why is yours so Good, I've got a perl/flash server that does the same thing for any amount of users and it's freeware. What the hell is it exactly. You need a more technical description on that site. I have used the xml socket for chat rooms before. I've gotten it to work great but the port on my web server always times out after a couple minutes.

    Anyways what's the difference between the free perl servers that do the same thing. The Perl Flash server works on an server that has perl installed.

    Here's some sample code for the Perl Server.
    $port=65000;
    $linelength=1000;

    require 5.002;
    use IO::Socket;
    use IO::Select;
    &initialize;

    while(@ready = $select->can_read) {
    for $socket (@ready) {
    if($socket == $listen) {
    &connection;
    } else {
    $socket->recv($line,$linelength);
    if($line eq "") {
    &disconnection;
    } else {
    &broadcast($line);
    }
    }
    }
    }


    sub initialize {
    $ARGV[0] ? $port=$ARGV[0] : $port=$port;
    $nullstring="\000";
    $listen = IO::Socket::INET->new(Proto => "tcp", LocalPort => $port, Listen => 1, Reuse => 1) or die $!;
    $select = IO::Select->new($listen);
    }

    sub connection {
    $new = $listen->accept;
    $select->add($new);
    print $new->fileno . ": connected\n";
    &numclients;
    }

    sub disconnection {
    print $socket->fileno . ": disconnected\n";
    $select->remove($socket);
    $socket->close;
    &numclients;
    }

    sub numclients {
    $numofclients=$select->count()-1;
    $clientstext="<NUMCLIENTS>$numofclients</NUMCLIENTS>";
    &broadcast($clientstext.$nullstring);
    }

    sub broadcast {
    for $eachsocket ($select->handles) {
    if ($eachsocket==$listen) {
    next;
    } else {
    $eachsocket->send($_[0]) or do {
    &disconnection;
    }
    }
    }
    }

    1;


    [Edited by snowdude on 04-28-2001 at 07:13 PM]

  3. #3
    Member
    Join Date
    Mar 2001
    Posts
    79
    thnx for Perl code

    had great time reading it

  4. #4
    Junior Member
    Join Date
    Jan 2001
    Posts
    8

    What's so special ...

    What's so special about it?

    Well, we're not claiming it's a new and unique beast, that's not the point. It is an XMLSocket server, so it's basically the same concept as other such servers, since it has to be compatible with Flash's XMLSocket functionality.

    But, in addition to being easy to install and use, it is a multi-channel server, and has a superchannel for administration and logging. It comes with example code and sample applications, which should save you quite a bit of time. And we'll be adding to those over the next few months. We'll probably be posting a Flash whiteboard example at some point soon, and a "nowmeter", allowing visitors to a webpage to see how many people are there, post an instant poll, etc.

    And you get support from our programmers. Not everyone has the time or resources to roll their own server code, though it's definitely a viable and interesting option if you do have the knowledge. We agree that more technical information should be on the site. We'll be implementing discussion boards next week.

    We have an number of plans for augmenting the server. It's not apparent on the site but we have a Java client that can be used with the server and through some tricks can allow you to get through a firewall (e.g. connect on port 80, and if necessary http tunneling). With some of our applications, we've implemented archiving, persistence (useful with whiteboards), and authentication, through subsidiary servers and databases. The enterprise version will eventual have tunneling, relay capability (to scale up to tens of thousand users) and other features.

    We've been working with various live Flash environments for over a year now, and we want to promote the spread of live applications ("nowness") on the web. Laurie Anderson once said that the Web was a ghost town, because whenever you went somewhere, there was nobody there. We'd like to help change that.

  5. #5
    Member
    Join Date
    Mar 2001
    Posts
    79
    well

    i'd choose perl anyway

    maybe coz i'm dealing ith it for a long time

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Posts
    687
    The Flash now server sounds good. And sounds like it will make a lot of things easier and save time. But if you really want to spread the word of live applications you should just make the source code free and available for anyone to download, then sell all the examples and features and newer versions. But I realize that everyone's got to make some money, especially if they've spent a long time developing it. I would really like to see some more technical information on your site though.

    I just mess around with this stuff though, but I definitly see big possibilities for the future. I've got one question though. On some web servers when I try to run a chat server the Port times out after about 5 minutes do you know what's causing this and any kind of a remedy, i've tried a couple things but when I'm not in direct control of the web server the Port connection always times out.

    The flash code to go along with the Perl Code I posted can be found at http://www.moock.org - they've got a nice Java Server there that you can use and modify. There server is in Java though - I tend to like using Perl more cause i'm more familiar but it lacks some of the functions. Later.


  7. #7
    Junior Member
    Join Date
    Apr 2001
    Posts
    23
    Hmm, I just left a flash client running all weekend and it was still connected this morning, so It should not happen, I guess I'd need more details.

    by web server I'm guessing you just mean the physical computer not the "web server" software. (the server is a separate process right?)

    do you mean the server stays running, but the clients get disconnected?

  8. #8
    Senior Member
    Join Date
    Jun 2000
    Posts
    687
    Yeah what flash client/server are you running. I've gotten the flash server to run continuosly on my own computer using the apache server. But when I try it on different host servers (like the pay 20$ a month and we host your site kind) the port connection disconnects after about 10 mins. (i.e I would have to reset the chat server every couple of minutes either by using a telnet command to start the server or an http request to start the server). I need the flash server to keep running for an indefinite amount of time. Can certain host servers set their ports to automatically time out after a certain amount of time to prohibit this type of open port connection. I had a hard time finding a port that would even work at all on the same server.

    I guess overall I don't know enough about ports and xml sockets. I would like to be able to keep an open connection to a port and have it listen and broadcast coordinates of movie clips each time a user changes it's position. I've got the coordinate system down, I've got the xml down, I can save the coordinates of movie clips and have them stay the same each time a user enters a site, but I don't have the ports and the java/perl flash server down. I would like to have it live instead of having to save them in a database.

    Here's an example of saving coordinates and having them be remembered and unique to each user, there's some really big things you with this type of thing. This is just a simple example though - check it out and let me know what you think i've been working on it for the past day or so.

    The Link: http://65.6.103.47/
    (it's only 19k but it's on a cable connection so it might be a little slow to respond).
    -Jeff.

  9. #9
    Junior Member
    Join Date
    Apr 2001
    Posts
    23
    >Yeah what flash client/server are you running.

    Well our NowServer of course. see above post http://www.nowcentral.com.
    the flash client that was ok over this weekend was the tic tac toe example. but I've done the same testing with various other products, (in fact using a Java client, I know that 4 pc's have remained connected for weeks without a problem, [in a kiosk setup] but I've never left a flash client running that long)


    >I've gotten the flash server to run continuously on my own computer using the apache server.

    Ok so I don't get this at all? are you trying to run the server in a cgi process? The server should run as it's own process, ours runs as a non console app in windows and a daemon in linux. The Linux version has been running on our and clients servers for months at a time, but you start it from the command line or a sysV startup script.

    >I would like to have it live instead of having to save them in a database.

    right, so multiple users would be in the same swf/channel seeing each other move the object yes? that should work, but to have the persistence like your current setup does from login to login you would still need the database as well.

  10. #10
    Junior Member
    Join Date
    Apr 2001
    Posts
    23
    Originally posted by HTTP-404FnF
    well
    i'd choose perl anyway
    maybe coz i'm dealing ith it for a long time
    I prefer PERL as well, keep an eye on our server though, the server plugins are PERL clients. I'll try to get the examples of that cleaned up and posted soon.

  11. #11
    Senior Member
    Join Date
    Jun 2000
    Posts
    687
    Yeah I know all my posts in this thread are really confusing, but then again i don't really know what I'm talking about. I was using a Perl server located in my cgi-bin to establish the socket connection on the specified port. It was sorta based on the moock java server. The reason being was just that I tend to find Perl really easy to work with. But the problem with this is that about 3 mins after I opened the connection with the Perl server it would close the connection automatically. Anyways don't bother responding to this one because the Perl server's a lost cause. If someone can get it to work though let me know. All the codes posted on this thread.

    Anyways as soon as I get a chance hopefully I'll have some time to mess around with the FlashNow server and try to get that to work. Later.

    (and hey to everyone else reading this quite trying to hack into that site I posted on an early thread - just kidding it was sorta cool to see that someone had actually hacked part of that - how'd you get the / to keep appearing in all the messages.)http://65.6.103.47/

  12. #12
    Senior Member
    Join Date
    Jun 2000
    Posts
    687

    Example of using Perl with xml socket connection

    here's an example of a multi-user Perl/XML/Flash chat.

    you should get a feel for what i was talking about earlier in the thread.

    Goto: http://www.coloradoboarders.com/chatFinal.html

    If you try to login and the connection fails, open this link with a different browser:

    http://www.coloradoboarders.com/cgi-bin/ChatServer.pl

    This starts the Perl Chat Server. It should say "Chat Started". Then hit the first link and login.

    You probably won't find anyone on it but you can test it out. (It's similiar to the moock chat but using Perl).
    Later.
    [Edited by snowdude on 05-02-2001 at 03:26 AM]

  13. #13
    Junior Member
    Join Date
    Jan 2001
    Posts
    8

    New features and client app

    Just a post to let people know we've developed some new features for FlashNow.

    We're adding a user list, private messaging, named channels, a basic archiver, and a cool animated "PeopleMeter" client application that displays the number of people currently ("now") on a web page. The Linux version will also be available. The new installation should be ready by the middle of next week.

    Each week we hope to post new features or sample applications. As usual, comments, critiques, and suggestions actively solicited. We've also put a forum on the site. Thanks!

    PS. We gave our first software grant to Mark Campbell for an art site in Scotland.



  14. #14
    Member
    Join Date
    Nov 2000
    Posts
    31

    cool

    i have started the fla for multiplayer versions of mario and zelda, if this app does what it says it does without me having to learn a new language i'd pay twice the price, well work would.

    I was erading that it is possible to make a client network of XML connections ie user1 connected to user2, 3, and 4 rather than users 1, 2, 3, and 4 all connected to the server. The main advantage being lower server load, is that possible/viable? and or is it available now ?

    M

  15. #15
    Junior Member
    Join Date
    Jan 2001
    Posts
    8

    mario, zelda, and beyond ...

    We'd love to help out with the mario/zelda projects, let us know if you have any questions or problems.

    Re: User1 > User2 connections, this is a kind of peer-to-peer network and we have talked about the possibility. I'll see if I can get you an answer on this.

    However, the server load is very small on these kinds of applications, since the only data being exchanged is a series of control strings.




  16. #16
    Junior Member
    Join Date
    Apr 2001
    Posts
    23

    Re: cool

    Flash will not support a peer 2 peer system by itself.
    In order to do that each client needs to also become a server, and the flash (and Java) security models are designed so that is not supposed to be possible.

    Using a plug-in or a signed applet you can set up this kind of network and, via FSCommands and some JavaScript in the HTML page use it to connect multiple flash players. I've been looking into this for some collaborative environments. (but really for more high volume data like voice or image streams)

    However, this makes the most sense is when you have high volume/bandwidth materials to transfer, or a highly unstable network. What you give up are low-latency and predictability, which are normally crucial to gaming. Also, like John said performance is not really a big issue with just messaging if you distribute as much game logic into the clients and have little computation on the server.
    (and with a peer 2 peer system, you would of course have to have all logic on the clients anyway) In addition, you can build a server farm by using a relay topology like IRC and web casting do to scale to high volumes of users. (the relay system is very similar to the peer 2 peer but much easyer because it's in a controled enviroment)

    but, then again back on the other hand peer 2 peer is *very* cool.

  17. #17
    Junior Member
    Join Date
    Jan 2001
    Posts
    8

    Quasi peer to peer

    We've also talked about a kind of quasi peer 2 peer application where a autoinstall app becomes a "personal server". It's temporary and limited but it allows a "host" to initiate a shared room or game and invite others into it. It has some of the advantages of p2p and some of the advantages of a permanent-server-based architecture.

  18. #18
    Junior Member
    Join Date
    Dec 2000
    Posts
    29
    peer to peer is good for 1 to 1 communication, but there are some serious draw backs when your talking about multiuser apps like games or chats.

    You end up burning a LOT of extra bandwidth (sending the same packets to multiple clients), or you have super high latency (the daisy chain effect).

    mnm, if you interested in creating a multiuser flash game, gimme a holler, and we can launch it on the IGE server. It was built specifically to handle multiplayer games.





  19. #19
    Junior Member
    Join Date
    Jan 2001
    Posts
    8

    Update!

    Hi everybody …

    It's taken longer than we'd hoped, but we finally got the update up, in both Windows and Linux versions, on http://www.nowcentral.com. We’ve added a number of new features:

    - A new server-based user list feature makes it easier to create a chat room participant list or other user-tracking function.

    - Named channels are now possible; you are no longer restricted to numbered channels, but can use any string (e.g. ChatRoom1) to identify a channel.

    - The private messaging feature allows you to set up a subchannel for communicating between any two users in a room (e.g. private chat). It’s also useful for controlling the functionality available to individual users during a session.

    Thanks!

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

Poll by Flashkit.com