Coding a simple server side routine to implement a matchmaking system.

Hi guys, I'm trying to make a simple matchmaking system in which users can do the following:
- A random user clicks "Play Game", and if another user previously clicked the same "Play Game" button, and he is not currently in a match, they get into a match and start playing versus each other. This is a one versus one game only. For now, no lobby or anything like that is required.
I explored some options, and I reliazed that my needs could be met with something simpler than what other framworks can offer me.
I was thinking about coding it with PHP, after all, all I need is a way to manage the states of the players and their farID's. The ingame part of the game is made with NetStream, so far it works, but only if I provde manually their farID's.
Some time ago IIRC, I saw an example made in Python, but I lost track of it.
Any help would be much appreciated .

quote:
Originally posted by:
happysailingdude
Oops, i think i was suffering from a mental block - sorry!
I now have <cfif IsDefined("form.emailAddress") AND
form.emailAddress CONTAINS "@">
Natutally I am mindful that one @ symbol does not make an
email address, but it's better than nothing
None the less I guess this sort of thing is something lots of
new programmers must come up against, does anyone want to make any
comments regarding best practice for simple form validation?
Don't overdo the cfif isDefined stuff. Once you have
established that you have received the form, all your text boxes,
textareas, selects, and hidden fields will be defined. If you
pre-checked your radio buttons, they will always be defined. The
only form fields that might not be are check boxes.
Best practices for anything are a matter of opinion. This
includes form validation. Cold Fusion offers some easy ways to do
this. cfform/cfinput is easy and effective, but limited to a
certain extent. If you want to add more client side validation, you
have to learn javascript. For server side, they offer a hidden
field way of doing things, or if you give your field the right
name, validation just happens. It is easy to code, but the results
are ugly.

Similar Messages

  • NetStream.Play.InsufficientBW when streaming server side playlist

    Hi
    I am streaming pre recorded audio files (mp4) to an AIR client. I have tried two different solutions,
    streaming the file directly with the NetStream.play("mp4:xxxxx.m4a") and creating a server side playlist, adding the
    same sound clip and then streaming the playlist. The problem is, when streaming the playlist i get a few NetStream.Play.InsufficientBW, this does not happen when streaming the file direct. Both solutions uses bufferTime=1.0
    I would like to use a server side playlist to implement a simple key solution so that the client dont know the full path to
    the file, but instead sends a key to a custom server side function that looks up the file path and creates a stream for the client.
    TIA
    Ruben Chadien
    FMS 4.0(linux)

    Subscribing via playlist and playing file directly are two different things , as first one is live mode of play while other is playing recorded file - so the way streams are delivered are also quite different. Can you try setting higher buffer and see if that helps or if you don't want to set higher buffer, see if disabling AggregateMessages (you will find the tag in Application.xml under Live/Queue) helps

  • How RMI implements multithreading in Server-side?

    In [http://my.execpc.com/~gopalan/java/rmi_internals.html] says:
    "On the server side, when a client connects to the server socket, a new thread is forked to deal with the incoming call. The original thread can continue listening to the original socket so that additional calls from other clients can be made."
    I have traced Java source code (jdk-6u18-ea-src-b05-jrl-18_nov_2009.jar) , but i could not find where and how Java RMI do it.
    Could anyone give me some hint? Thanks!

    In [http://my.execpc.com/~gopalan/java/rmi_internals.html] says:
    The status of that site is zero. All you can rely on is the RMI specification.
    "On the server side, when a client connects to the server socket, a new thread is forked to deal with the incoming call. The original thread can continue listening to the original socket so that additional calls from other clients can be made."That accurately describes the Sun implementation of RMI as of 1.5, the latest source code I have looked at. It doesn't accurately describe the IBM implementation nor I suspect the Sun 1.6 implementation.
    I have traced Java source code (jdk-6u18-ea-src-b05-jrl-18_nov_2009.jar) , but i could not find where and how Java RMI do it. So? Why does it matter? The RMI specification tells you what the multi-threading guarantees of RMI are. They are all you can rely on.

  • How to implement server side methods in client side player from main.asc?

    Hi,
    I am developing video player using RTMP NetConnection and NetStream object but it is giving me below Error. Can you please tell me how can I handle this. I have main.asc file form FMS server side but I don't know how to use it. 
    Async Error found = <br>Error #2095: flash.net.NetConnection was unable to invoke callback setUserID.
    Async Error found = <br>Error #2095: flash.net.NetConnection was unable to invoke callback syncChat.
    Async Error found = <br>Error #2095: flash.net.NetConnection was unable to invoke callback playingNotComplete.
    Async Error found = <br>Error #2095: flash.net.NetConnection was unable to invoke callback nowPlaying.
    Can anyone please help me ot solve this issue?
    Best regards,
    Sunil kumar

    javascript are run on the client side.. but i think what you actually mean is getting some validation to your database without submitting the form?. yes it doesn't consumes time and memory of server.. why not use ajax so you can only submit a little request.. rather than submitting the whole page..

  • Implementation Options: Server Side Object Model & Client Side Object Model

    Hi All, I'm design a custom web application and it will be deploy on SharePoint 2010/2013 (to be confirmed) server, and I found some aritical as follows:
    http://consultingblogs.emc.com/sanjaypatel/archive/2011/09/17/comparison-between-server-side-object-model-client-object-model-rest-api-s-and-decision-matrix-on-what-to-use-when.aspx
    May I ask ask your advice for following items?
    1) Is the above URL still valid? e.g. Vice Versa for SharePoint 2013?
    2) Microsoft has a phase out plan for server side object model or not? (e.g. MOSS 202X)
    3) For programmatcally update of SharePoint permission: should I call client-side OM instead of server-side OM even I will deploy the web application to SharePoint server?
    Thank you very much.
    .NET Beginner 3.5

    In sharepoint 2013 I don't think this link is
    http://consultingblogs.emc.com/sanjaypatel/archive/2011/09/17/comparison-between-server-side-object-model-client-object-model-rest-api-s-and-decision-matrix-on-what-to-use-when.aspxis reliable at all.
    what is your say?
    ====================================================
     Hi All, I'm design a custom web application and it will be deploy on SharePoint 2010/2013 (to be confirmed) server, and I found some aritical as follows:
    http://consultingblogs.emc.com/sanjaypatel/archive/2011/09/17/comparison-between-server-side-object-model-client-object-model-rest-api-s-and-decision-matrix-on-what-to-use-when.aspx
    May I ask ask your advice for following items?
    1) Is the above URL still valid? e.g. Vice Versa for SharePoint 2013?
    2) Microsoft has a phase out plan for server side object model or not? (e.g. MOSS 202X)
    3) For programmatcally update of SharePoint permission: should I call client-side OM instead of server-side OM even I will deploy the web application to SharePoint server?
    Thank you very much.
    .NET Beginner 3.5

  • Multiple room management -- best practice -- server side http api update?

    Hi Folks, 
    Some of the forum postings on multiple room management are over year old now.  I have student/tutor chat application which has been in the wild for 5 months now and appears to be working well.  There is a single tutor per room, multiple chats and soon to be a whiteboard per student, which is shared with the tutor in a tabbed UI. 
    It is now time to fill out the multiple tutor functionality, which I considered and researched when building, but did not come to any conclusions.   I'm leaning towards a server side implementation.  Is there an impending update to the http api?
    Here is what I understand to be the flow:
    1) server side management of who is accessing the room
    2) load balance and manage the room access 1 time user and owner session from the server side
    3) for my implementation, a tutor will need to login to the room, in order for it to be available
    4) Any reconnection would in turn need to be managed by the server side, and is really a special case of room load balancing.
    My fear is that at some point I'm going to need access to the number of students in the room or similar and this is not available, so that I'll need client functionality, which will need update the server side manager.
    As well, I'm concerned about delays on the server side access to which might create race conditions in a re-connect situation.  User attempts to reconnect, but server side manager thinks that the user is already connected.
    Surely this simple room management has been built, does anyone have any wisdom they can impart?  Is there any best practice guidance or any samples?
    Thanks,
    Doug

    Hi Raff, Thanks a ton for the response.
    I wasn't clear on what I was calling load balancing.  What I mean by this is room assignment for student clients.  We have one tutor per room.  There are multiple students per room, but each is in their own one-on-one chat with the tutor.
    I'm very much struggling with where to do the room assignment / room managemnt, on the server side or on the client side (if that is even possible).  In my testing it is taking upwards of 10 seconds minimum to get a list of rooms (4 virtually empty rooms) and to query the users in a single room (also a minimum of users/nodes in the queried room).   If after this point, I 'redirect' the student to the least full room, then the student incurs the cost of creating a new session and logging into the room.  As well I intend to do a bit of xml parsing, and other processing, so that 10 seconds is likely to grow.
    Would I see better performance trying to do this in the client?
    As far as the server side, at what point does a room go to 'not-active'?
    When I'm querying the roomList, I am considered one of the 'OWNER' users in the UserLists.  At what point can it be safe to assume that I have left the room? 
    Is there documentation on the meaning and lifecycle of the different status codes?  not-active,  not-running, and ok?  Are there others?
    How much staleness can I expect from the server-side queries?
    As far as feature set, the only thing that comes to mind is xpath and or wild card support for getNode() but i think this was mentioned in other posts.
    Regarding the reconnection issues, I am timing out the student after inactivity, and this is probably by and large the bulk of my reconnect use cases.  This and any logout interaction from the student presents a use case where I  may want reassign the student return to the same room as before.  I can envision scenarios of a preferred tutor if available etc.  In this case, I'll need to know list of rooms.  In terms of reconnection failover, this is not not a LCCS / FMS issue.
    Thanks again for responding.

  • JNI via Server-Side Language

    I'd like to use the following post as a reference: http://72.5.124.102/thread.jspa?threadID=788137&messageID=4479784
    "The DLL will remain loaded between calls, so if you use a global variable to store the connection then it should be ok. "
    Of course this makes logical sense. However, JNI doesn't have a handle from my understanding... JNI looks like this:
    private native void nativeMethodInvoke();
    static {
        System.load(path+dllName) // many alts to this, but yea.
    // somewhere in main thread....
    SelfClass varRefToSelf=new SelfClass();
    // where SelfClass is the current class running.
    // This doesn't make sense to me, considering usage of 'this' - so if anyone can explain that, I would greatly appreciate it.
    varRefToSelf.nativeMethodInvoke();So.... am I supposed to keep a global reference within my class, to itself?!?
    The actual problem is that I'm using a server-side language to invoke Java, and thus C++ via JNI. However, the server-side language is creating a new instance of the JAR upon each invocation. So my plan was to pass a reference to the module handle, and somehow manage to get that back to server-side language, and then furthermore back to Java JNI. Am thinking about moving to a servlet instead, since this doesn't appear to be possible - as unfortunate as that is.
    Would SingleThreadModel work in this case? Or should I have C++ thread itself, so when Java makes a call, I can let C++ handle data by forwarding to correct module in memory? Assuming the above mentioned post is accurate, then the DLL, when loaded by Java, will stay in memory until unloaded. If the jvm is exiting after each server-side invocation, I must assume multiple instances of the dll are being created. So, am thinking this prospect will work... servlets aside...
    Any help is appreciated. I clearly do not understand JNI as well as I should.
    *Edit:
    I have already tried this, and found that C++ DLL's thread is definitely active in memory post-jvm exit. The DLL also appears to be loaded multiple times, as the data I'm dealing with appears to be unique, in that it's not "stepping into itself" and overwriting pointers, or anything.
    Am I going to have to create an instance of my class, via itself, to launch itself in the jvm manually - to keep the reference to dll in memory?
    Although that statement sounds terribly redundant... I believe it's accurate...
    1.) Create instance of class that's called by server-side, launch it under new jvm
    2.) Have orig class return to server-side as normal, and forward any new requests to the jvm-launched "self"; based on detection of class/jvm in memory...
    For being cross-platform "magical", Java sure makes it difficult to perform pretty basic tasks....

    Thanks for the great information jschell, this clears up alot. I'll play around with these new prospects and see if I can get this running properly.
    Also, let me define more what I'm actually doing.
    I'm using Railo, and a CFX "tag" to invoke a JAR. This Jar contains the JNI to execute a DLL's code. This dll's code is merely in place to perform some server tasks - mostly routine file maintenance, and checks to ensure normal operation. Some of this includes db queries. Yes this can be done in Java for the most part, but we plan to use the DLL exports later in a deployment scenario.
    So, "Did you mean it is loading the jar each time?", I do believe so. However, the instances appear to be different. If i were to create a thread within the JNI invoking class, which i have tried by the way, and create a global variable with some value, the second calling of the JAR file reports that it has not been defined yet on class initialization. Additionally, the thread I mentioned also halts, and does not exist within the second calling.
    Let me show some actual code...
    Test.cfm...
    <cfx_mytag Library="myLibrary.dll" task="function1">
    <cfscript>
    ... // do some stuff.
    </cfscript>If I were to alter that to:
    <cfx_mytag Library="myLibrary.dll" task="function1">
    <cfx_mytag Library="myLibrary.dll" task="function2">
    <cfscript>
    ... // do some stuff.
    </cfscript>I found that function2 in the same JAR, loaded via "cfx_mytag", reports inexistance of function1's execution - which registered a value into a global var.
    This is why I must assume that the JAR is being loaded independantly - each time. Correct me if wrong. Perhaps my terminology is off - the class within the jar file is multi-instanced, as far as I can tell. Or rather... Railo is creating mutliple instances of this class - and thus I lose my handle to my dll - every call... Seemingly at least.
    //Java...
    import com.allaire.cfx.*;
    public final class myClass implements CustomTag {
         private Request req;
         private Response res;
            public boolean igetresetoften;
         private native void gogoGadgetDLL();
         public myClass() {
        public void processRequest(Request request,Response response) throws Exception {
             this.req=request;this.res=response;
              if (!this.igetresetoften) {
                     igetresetoften=true;
                     res.write("yea... this is annoying");
                // in actual code - function1() assigns global var.
                // and function2() reports to response buffer the value of the global var , which is constantly false each run.
    }Notice the similarity to a servlet (request/response buffers). I've dealt with servlets, so I know that all requests are threaded.. but the global vars in a servlet are, in fact, ... global. Not in this case, it would seem.
    Thanks again, I'll let you know of my results, late tonight.
    Edited by: jSD7 on Nov 13, 2009 4:20 PM

  • Server side tracking on non-OSX server

    Does anyone aware of attempts of reproducing server side tracking on non-MacOSX server platform?
    Our primary storage is based on opensolaris + zfs, giving us a lot of advantages. But synchronization of mobile users always takes some serious amount of time.
    Obviously re-exporting home directories through OSX server doesn't change something, because server side tracking requires filesystem to be local on server.
    I can guess that protocol should be relatively simple and doable on other unixes (as soon you get some way to track filesystem changes).

    while part of it may be technically feasible, i've never seen or heard anything about implementing server side tracking on a non-os x server. at the very least, the server runs sshd on an alternate port for client communication. beyond that, i don't know what magic is involved.
    in practice, i haven't seen it work reliably on os x server, though i haven't done any testing with this enabled on 10.6 server yet. it may not be worth pursuing.

  • Generating feedback messages on server-side vs client-side?

    Hello,
    I am maintening a client/server app (Swing client, no Web pages), basically an order processing system. The biggest part of it is to verify the conformity of orders to a set of business rules.
    As usual, some of the verification can be made early on the client-side, but most of the verification work is done on the server-side. My problem is, I don't find a very satisfactory way to generate the user feedback to be displayed to the user.
    If I generate them as Strings (or HTML Strings) on the server, where the rules are checked, this constrains the way these can be displayed on the client, and makes maintenance of the human-readable strings awkward and risky (e.g. localization, or restructuring the messages, like sorting them by severity vs by affected entity).
    If I generate them on the client, I need a class to vehicle the diagnosis form server to client, and this class and its usage tends to become awkward in itself.
    Concretely:
    The initial version generated human-readable strings on the server, which assumed the messages would be displayed as strings in a JOptionPane.
    Moreover, the logic evolved to distinguish between Info, Warning and Error messages, to be displayed in different colors of course, so the Strings evolved into HTML Strings, still generated on the server.
    Do you think this approach is safe?
    I'm afraid a simple maintenance of the strings (like, sorting the errors by severity vs by affected entity, filtering the strings,...) becomes a server-side development, which is a bit more risky (I would have to review code ownership policies, VCS and code-sharing policies,... to let less experienced staff maintain the darn error Strings).
    Moreover, if the client app evolve to display the errors in complex widgets (colors in a tree/table, with tooltips), the server-side generated HTML strings would be constraining : coloring or tooltipping Tree nodes would now mean parsing the String to extract the "error level" or the "affected entity", which is quite inelegant and inflexible.
    My current idea was then to use a collecting parameter to collect validation messages on the server, and traverse them on the client:
    I designed a naive ErrorList class, with methods such as addInfo(String), addWarning(String), addError(Strin), and the corresponding getErrors() and hasErrors()/hasWarnings() methods. I can then generate the Strings (or whatever widget fits better, such as a table) on the client side. Moreover, I can add the client-side messages to the bag...
    All nice and well, but the customer requested that the error messages be formatted such as "The profile <profile name in bold> does not allow you to order service <service name in italics>".
    To format that on the client, my ErrorList class should evolve so that for a given message, I know that the error is of type ("incompatibility between profile and service", that the service is X and the prodile is Y).
    That forces me to add in some API (shared by the client and server) the list of error types, and the data each error type requires.
    I can evolve my ErrorList API to break up messages into a DTO giving (type, affected entity, arg1, arg2,...), but anyway the server and client have to agree on what is arg1, etc... which is a hidden coupling.
    Do you use and recommend such an approach for server-to-client feedback: a collecting parameter in which the server puts the "errors", and that the client traverses to display the messages)? In particuler, isn't the coupling hard to maintain?
    Thansk in advance,
    J.

    Presumably you are not over-engineering in that you
    know that localization is a problem rather than that
    in all possible worlds in might be.I appreciate your delicate questioning... I definitely have read much ruder ways to say YAGNI to a poster...
    I do know that the customer will knit-pick to reword and reformat the messages. But I won't need to translate the messages to other locales. In that regard, I ackowledge my usage of the term localization is a bit liberal, but I think I should to extract the messages from the code, to be able to maintain them separately - keeping only experienced staff's hand in the server's core.
    That is actually my question 1): from experience, is it worth the trouble to separate code and human-readable text, knowing that the text WILL have to be maintained?
    Question 2 is about how to implement this.
    In particular, the built-in MessageFormat templating engine, though originally introduced for i18n, actually suits my needs (including MessageFormat-built messages) and developing or using any other templating engine would probably be an overkill.
    Given that there are two types of messages.
    1. Fixed
    2. Parameter driven.
    In both cases you need to return an id which
    identifies the message. The client has a locale
    specific resource source which has a matching id.
    From there a string is derived.
    If the error requires parameters then the string has
    formatting values in it and it s written with the
    returned parameters. See java.text.MessageFormat.Yes. In some cases I don't know yet whether parameters will be displayed. I can conservatively assume the message requires a MessageFormat, and give all parameters (in my case, use rname, profile name, command id, service name, order date,...), whether thay are displayed or not in the final message.
    Be warned you MUST deal with the possibility that a
    id does not exist in the client, if so have a default
    message that displays the id and any parameters.Good point.
    "The customer name field can not be longer than 15
    characters".
    In the above the "15" would a parameter.Yes. The trouble is, you have to document somewhere (Sun suggests in the resource bundle file), that for error id #123456, the number of characters in in the '{0}', or in the {6}. I don't feel confident with that (this is the "coupling" part in my question 2�).
    Thanks for your advices.

  • SOAP server side ... how to ... ?

    Hi,
    I'm new to the soap technology.
    I want to write a java application that use SOAP.
    I've downloaded JAXM to implement the client side :
    SOAPMessage response = con.call(message,endpoint);
    But I don't know what I must do to the server side ?
    A servlet ? What must I invoke on the server ?
    (I have IIS with servletexec, but I don't know if a servlet is necessary???)
    I just want to implement a server side that answer the SOAP request.
    Please,
    any information about server side
    or a little "startpoint" to begin is welcome.
    Very thanks.

    A good place to start are the tutorials and sample code that are found at:
    http://www-106.ibm.com/developerworks/webservices/library/ws-peer1/?dwzone=ws
    http://www-106.ibm.com/developerworks/webservices/library/ws-peer2/?dwzone=ws
    http://www-106.ibm.com/developerworks/webservices/library/ws-peer3/?dwzone=ws
    http://www-106.ibm.com/developerworks/webservices/library/ws-peer4/?dwzone=ws
    The second and third parts were the best - best coding samples. Also you might want to check out the Apache SOAP website - have you got your SOAP API? It can be found on:
    http://xml.apache.org/soap/index.html
    Also, the Apache SOAP website has a good bunch of info:
    http://xml.apache.org/soap/docs/index.html
    You'll need to have the SOAP, xerces.jar, and a few other things to fully implement SOAP. I've put together several client/server apps using different types of requirements.
    Does this help??

  • Server side does not detect network failure

    Hi folks,
    I coded a simple chat program. When a client connects to the multi-thread server, server shows newly connected client's IP address. Now, if the connection between client and server is down, client detects and terminates itself but server does not. The server still shows that client as connected. when I traced the server side, I found out that server was waiting at the readObject (client object input stream) line but it didn't throw any IOException. I tried to send some message to all connected client at every 20 seconds, so I expected to catch IOException when the server did not reach the client. Unfortunately, it didn't work. That is my question how can server side detect network failure?
    Thanks for help.
    Regards
    Bulent

    That is how TCP works (noting that it has nothing to do with java.)
    Your solution is one of the following or some combination...
    - If the server does not receive something every X time period then it disconnects.
    - If the server has not received something after X time period it sends a keep alive message to the client. If the client does not respond (or the message fails) then the server disconnects.

  • Server side buffering settings for video

    I pump my video (both live streaming and VOD) through a popular CDN.  They control the server side (FMS) settings.  I can request that they change things and they do so and let me know when I can test.
    I'm wondering about server side buffering settings.  Is there supposed to be some sort of coordination between the buffering settings there and the client side buffering settings I implement in my video player?
    The reason I ask is I get wierd buffering behaviors in my client side player under certain conditions and there doesn't seem to be much to adjust there other than the NetStream.bufferTime property.
    For instance, if I set the bufferTime property in my client viewer to 10 seconds, the player just seems to ignore it and starts playing the stream right away or within a second or two.  Other times I see crazy values in the bufferTime property, like 400 seconds (I check the property's value about every second).
    I'm wondering if there are some FMS settings that are overriding or are not working well with my client side buffer settings.  Is this possible?

    Not sure how to get this code to you.  There is no option here to  attach a file.  Trying to post inline here.  Hope it comes out ok.
    This  is a simple player.  The simplest.  No frills.  Just insert your RTMP  url to your FMS and your stream name in the string variables "rtmpURL"  and "streamName" at the top, compile and run.
    Here is a deployment of this player connected to my CDN where the file is currently playing:
    http://dcast.dyventive.com/cast/simple_player/player.html
    Also,  attached is an image I took when I ran the program and hit the refresh  button in the browser.  Note the giant bufferLength numbers in the debug  panel.
    Again note, I do not get this problem linking  directly to a recorded file.  I see this problem when playing a file on a  server or with a live stream.
    Can you see anything  obviously wrong?
    <?xml  version="1.0" encoding="utf-8"?>
    <mx:Application
         xmlns:mx="http://www.adobe.com/2006/mxml"
         layout="absolute"
         backgroundColor="#333333"
         initialize="init()">
         <mx:Script>
             <![CDATA[
                 //Note:  the method "connect()" on  line #49 starts the area  with the important connection code
                 import mx.containers.Canvas;
                 import flash.media.Video;
                 import flash.net.NetConnection;
                 import flash.net.NetStream;
                 private var vid:Video;
                 private var nc:NetConnection;
                 //Path to your FMS live streaming application
                 private var rtmpURL:String = "Insert your URL"; //Will be  used to connect to your FMS
                 private var buffer:Number = 5; //NetStream.bufferTime  property will be set with this.
                 private var streamName:String =  "Insert your server side  stream name here"; //This determines the channel you're watching  on the  server.           
                 private var ns:NetStream;
                 private var msg:Boolean;
                 [Bindable]
                 private var canvas_video:Canvas;//Will display some live  playback  stats
                 private var intervalMonitorBufferLengthEverySecond:uint;
                  private function init():void
                     vid=new Video();   
                     vid.width=720;
                     vid.height=480;                   
                     vid.smoothing = true;               
                     uic.addChild(vid);
                     connect();
                 public function onSecurityError(e:SecurityError):void
                     trace("Security error: ");
                 public function connect():void
                     nc = new NetConnection();
                     nc.client = this;
                     nc.addEventListener(NetStatusEvent.NET_STATUS,  netStatusHandler);
                     nc.connect(rtmpURL);                    
                 public function netStatusHandler(e:NetStatusEvent):void
                       switch (e.info.code) {
                         case "NetConnection.Connect.Success":
                             netconnectionStatus.text = e.info.code;
                             reconnectStatus.text = "N/A";
                             trace("Connected successfully");
                             createNS();                    
                             break;                                               
                 public function createNS():void
                     trace("Creating NetStream");
                     ns=new NetStream(nc);
                     ns.addEventListener(NetStatusEvent.NET_STATUS,  netStreamStatusHandler);
                     vid.attachNetStream(ns);
                     //Handle onMetaData and onCuePoint event callbacks:  solution at http://tinyurl.com/mkadas
                     //See another solution at  http://www.adobe.com/devnet/flash/quickstart/metadata_cue_points/
                     var infoClient:Object = new Object();
                     infoClient.onMetaData = function oMD():void {};
                     infoClient.onCuePoint = function oCP():void {}; 
                     ns.client = infoClient;   
                     ns.play(streamName);   
                     ns.bufferTime = buffer;                   
                     ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR,  asyncErrorHandler);
                     function asyncErrorHandler(event:AsyncErrorEvent):void {
                         trace(event.text);
                     //Set up the interval that will be used to monitor the  bufferLength property.
                     //monPlayback() will be the funciton that will do the  work.   
                     intervalMonitorBufferLengthEverySecond =  setInterval(monPlayback, 1000);
                 public function  netStreamStatusHandler(e:NetStatusEvent):void
                      switch (e.info.code) {
                         case "NetStream.Buffer.Empty":
                             netstreamStatus.text = e.info.code;
                             textAreaDebugPanel.text += "Buffer empty:\n";
                             trace("Buffer empty: ");
                             break;
                         case "NetStream.Buffer.Full":
                             netstreamStatus.text = e.info.code;
                             textAreaDebugPanel.text += "Buffer full:\n";
                             trace("Buffer full:");
                             break;
                          case "NetStream.Play.Start":
                              netstreamStatus.text = e.info.code;
                              textAreaDebugPanel.text += "Buffer empty:\n";
                             trace("Play start:");
                             break;                        
                 //Get the current ns.bufferLength value, format it, and  display it to the screen.
                 //"bufferLen" is the key var here.
                 public function monPlayback():void {               
                     var currentBuffer:Number =  Math.round((ns.bufferLength/ns.bufferTime)*100);
                     var bufferLen:String = String(ns.bufferLength);//Here is  the actual bufferLength reading.
                                                                    //Use it  to show the user what's going on.
                     pb.value = currentBuffer;//updates the little buffer  slider on the screen
                     bufferPct.text = String(currentBuffer) + "%";
                     bufferTime.text = String(ns.bufferTime);
                     bufferLength.text = String(ns.bufferLength);
                     //Dump the bufferLen value to the debug panel.
                     textAreaDebugPanel.text += bufferLen + "\n";                
                     trace("Buffer length: " + bufferLen);
             public function onBWDone():void
                 //dispatchComplete(obj);
             ]]>
         </mx:Script>
         <mx:Canvas id="monitor"
             y="10" right="50">
             <mx:Text x="0" y="25" text="Buffer:" color="#FFFFFF"/>
             <mx:Text x="0" y="50" text="Buffer Time:"  color="#FFFFFF"/>
             <mx:Text x="0" y="75" text="Buffer Length:"  color="#FFFFFF"/>   
             <mx:Text x="0" y="100" text="NetConnection netStatus:"  color="#FFFFFF"/>
             <mx:Text x="0" y="125" text="NetStream netStatus:"  color="#FFFFFF"/>
             <mx:Text x="0" y="150" text="Reconnect:" color="#FFFFFF"/>
             <mx:HSlider x="145" y="25" id="pb" minimum="0" maximum="100"  snapInterval="1" enabled="true"/>
             <mx:Text x="100" y="25" height="20" id="bufferPct"  color="#FFFFFF"/>   
             <mx:Text x="145" y="50" height="20" id="bufferTime"  color="#FFFFFF"/>
             <mx:Text x="145" y="75" height="20" id="bufferLength"  color="#FFFFFF"/>   
             <mx:Text x="145" y="100" height="20" id="netconnectionStatus"  color="#FFFFFF"/>
             <mx:Text x="145" y="125" height="20" id="netstreamStatus"  color="#FFFFFF"/>
             <mx:Text x="145" y="150" height="20" id="reconnectStatus"  color="#FFFFFF" text="N/A"/>
         </mx:Canvas>
         <mx:UIComponent id="uic"
              x="50" y="10"/>
          <mx:TextArea id="textAreaDebugPanel"
              width="300" height="300"
              right="50" top="300"
               valueCommit="textAreaDebugPanel.verticalScrollPosition=textAreaDebugPanel.maxVerticalScro llPosition"/>
    </mx:Application>

  • What is the difference between jsp :include and server side include

    what is the difference between jsp :include and server side include(request dispatcher include method)????
    i understand that both request dispatcher include method and jsp:include take dynamic data,so when would one use request dispatcher include and when jsp:include.
    Is the usage interchangeable?i believe jsp include is used only for jsp/html but include directive can be used to include servlets ,jsp and html....correct me if i m wrong and
    do suggest if u hav ny other diff in this context...

    The difference really is: in what format do you want your inclusions? If your environment has many Java developers and only a few designers that focus mainly on, say, Flash, that might push you more towards the server-side include() directive. Or, if you have a large set of pages that receive dynamic content that is displayed in a consistent fashion (such as a workflow header area on a page).
    If, on the other hand, you have more web designers, there may be a greater desire to deal in markup rather than Java code. Java developers themselves might prefer to view markup (JSP) that more resembles the eventual output than something occuring in Java code.
    Finally, there are considerations of tiering. While it is totally possible to (and I have previously) implement 'view classes' that render markup or generate layout templates, JSP's offer, IMO, a subtle, psychological advantage. By forcing a developer to work in a different format, markup versus Java source, the separation on view from controller and model becomes a bit easier. It is still possible to make mistakes, but if a developer at some point notices, "Wait, I'm in a JSP, should I be importing a java.sql class?", then the choice to use JSP includes has paid off in spades.
    - Saish

  • Needs a background webdynpro application running at the server side

    Hi All,
    We have a requirement wherein we need to have an application running all the time at the server side to capture the response coming from a web application. Based on the response that the application receives, it needs to update some backend R/3 tables.
    We are thinking of a webdynpro java application.
    Can anyone suggest what kind of application needs to be implemented here?
    And what  would be the steps required to run the application at the server side without calling the application.
    Thanks & Regards,
    Anurag

    Hi Robin,
    Thanks for the detailed explaination.
    This may sound silly to you but I've another doubt which is as follows:
    As you mentioned that the external web application will be sending requests to our Web service(in SOAP envelopes) and rest of the functionality can be  achieved by our web service.
    Actually, we are expecting only responses from the external web application. The thing is that we are sending the requests to the external web applications from our custom webdynpro application and in return the web application will be sending us 2 responses.
    First response would be back to our WD java application URL(to the browser in which WD java app is running) which would get the response and display some message based on the response.
    Second would be to this web service which you have just suggested. We are having two responses so that even if the browser in which the WD java application is running gets accidentally closed, the response from the external web application must get captured somewhere else and should not get lost in any case.
    So, now since we are only expecting the response from the web application and we do not want any requests from the web application to our web service; how is this possible?
    I am asking the above question because you have mentioned that the external web application has to request our Web service but we want is only this web service to capture the response coming from the Web application.
    Or is it like the web application will send us the response string as request string to our Web Service and the web service will capture these response parameters as request parameters from the web application and do the further processing.
    But in that case, we do not want any response to be sent by the Web Service to the external web application.
    Please suggest if this is possible.
    Once again, many thanks for the help so far.
    Thanks & Regards,
    Anurag

  • Bw web report plugin http session hangs at the server side

    Hi,
    I am having problems when closing the browser of a BW web report. After I closed the browser by going File->close, I ran SM04 and found out the Plugin HTTP session hangs at the server side.
    How can we terminate the Plugin HTTP session at the server side when user closes the internet browser?
    I did implement a logoff function at my web template, if user clicks on the logoff, the Plugin HTTP session is terminated at server side correctly. But As you know, 50% of time user will close the report by closing the internet browser instead of clicking the logoff. That leaves lots of hanging Plugin HTTP sessions at our server side.
    By the way, we actived our BEX service at the SICF.
    Thanks for help!
    JA

    Hi
    If you want to avoid a blank page with logoff button, add opener=0
    <a href="<SAP_BW_URL CMD='LOG_OFF' ~command='logoff'
    >" onClick="javascript:window.close(opener=0);">Log off</a>
    If you want to close the session via X, use this code:
    create a sapscript function
    function closeSession()
    logoff()
    window.unload=CloseSession()
    However, the Plugin HTTP session isn't killed.
    Regards

Maybe you are looking for

  • Start up problems after 10.6.2 upgrade

    After upgrading to 10.6.2 my computer restarted and hung up on a circle with a line through it. I restarted, the same. i reinstalled Snow Leopard and can now run normally. I ran Disk Utility and it said everything was fine. I want to keep my iBook Pr

  • I can't get videos on my ipod classic

    hey sorry i'm quite new at this, but i'm having a little trouble with my ipod classic. i can't seem to copy video files from my computer to my itunes and then to my ipod. there's one music video that did get on my ipod but i don't know how or why it

  • Help ejecting a CD from MacBook Pro

    Hi I put an audio CD into the drive. The CD never shows up in iTunes, the Finder, etc. As far as the software is concerned, I don't have a CD in the laptop. However, there is most definitely a CD in there. Pressing/holding the Eject button does nothi

  • Cfmail not working properly, Log files not updating

    I'm still trying to get this CFmail problem corrected.  The problem is CFmail is only send the mail out sporadically.  In many cases it will send out the mail and still put the message in the undeliverable folder.  My smtp server shows that the conne

  • Transaction ME21N Screen layout Item Details TAB settings

    Hi, ME21N transaction some of item details TABS are invicible. Like "Delivery address tab" is invicible. I want to make it visible/changeble to enter address for ship to. Right now I am looking into SPRO on screen layout settings and transaction SHD0