How to make Client instantly recieve msg from Server

Hello! I'm trying to make a multiplayer game via Bluetooth (RFCOMM protocol) in J2ME. I already managed to detect devices both as a client and as a server. I also managed to send real-time message from client(s) to server in the following way:
// Pauses thread until Transmission occurs
StreamConnection conn = notifier.acceptAndOpen();
read_msg(conn); //this is the function which reads the date received from client
But when I try the above as a client I got some exception, but never mind actually.
Here is the actual problem:
I want to be able to send a message from server to client whenever I press a key so that the client instantly receives that message.
Now the only thing that comes to my mind is to periodically check (i.e. every 50 ms) StreamConnection and watch for some changes like this.
while(true) {
InputStream input = conn.openInputStream(); // conn is of type StreamConnection
//now I check if the messege received is the new one OR have I actually received a message
// here I pause the Thread for i.e. 60 ms
But that would be extremely CPU heavy and foolish, wouldn't it?
So is there a smart way to register when client gets a message from server?
Please give me some example for client side.
Edited by: leden on Sep 27, 2007 3:07 PM

One more question.
I have a server and many clients. Let's say I had already received the first message from every client with this piece of code:
for(int current_client = 0; current_client < MAX_CLIENTS; ++current_client) {
//notifier is of type StreamConnectionNotifier
StreamConnection conn = notifier.acceptAndOpen(); //wait for transmission to occur
String response = read_msg(conn); //read_msg actually reads the message
Now, at some other moment I want to send a message to one of the clients .
How could I do that?
Do I have to add this command in the for loop above, perhaps?:
conn_client[current_client] = conn;
then simply reply by doing:
OutputStream output = conn_list[who_I_want_to_send_msg_to].openOutputStream();
and then the code like in my first post
OR this whole procedure is totally wrong?
Please explaim me what does openOutputStream() actually do?
Edited by: leden on Sep 30, 2007 8:51 AM

Similar Messages

  • How to cancel (RWB) 15.000 msgs from AE ?

    Hi experts,
    In RWB I see more than 10,000 msgs in Holding status in AE - (Channel is a Receiver).
    There are no system errors at any time. I don't want to resend msgs, but to cancel them all.
    They are in EOIO order so I need to select them all at once to be able to cancel them.
    The problem is that the RWB doest display first messages but it display last ones, despite
    the use of free start-end date/time selection criteria.
    My question is how to make RWB display more msgs than 10,ooo. (I have 15.000 msgs all together).
    Or there is another way to cancel a huge number of holding msgs from Adapter Engine.
    Please help.
    J.

    Hi,
    You can try with transaction SWWL_TOPLEVEL or SWWL to delete work item corresponding to your messages.
    Regards,
    Juan

  • How to make client application

    hi....
    help me...^ ^ how to make client application(not standalone..)
    I seached bea document.. but I can't it.
    if someone have sample(.ear or .jar), I hope you it share...

    Hi
    Client Application can be any Java class, JSP etc which is a part of multi
    tier architecture which accepts input from Client and directs request to the
    middle tier for processing. You can refer to
    http://e-docs.bea.com/wls/docs61/jsp/index.html
    for building jsp's as Client application.
    Regards
    johny
    "kyungmoon" <[email protected]> wrote in message
    news:3c4f571d$[email protected]..
    >
    hi....
    help me...^ ^ how to make client application(not standalone..)
    I seached bea document.. but I can't it.
    if someone have sample(.ear or .jar), I hope you it share...

  • How to make report with access 2010 from SharePoint Discussion lists 2013

    HI,
    I want to make an access report from SharePoint Discussion lists 2013. When i open the list with access, the body of the list is in HTML format in access. Also if i reply something to one subject in the discussion, the reply is not mapped to that subject
    but instead it is shown as a separate entry in the database.
    Anyone can please help?
    SAN
    Santhiya
    Santhiya

    Hi Santhiya,
    I have seen a similar post from you, my understanding is that you wonder that the reply is mapped to the related subject. You can take a look at Daniel's reply in the following thread:
    http://social.technet.microsoft.com/Forums/en-US/dfb5bcb9-0076-412a-b34f-46aa9cfba876/how-to-make-report-with-access-2010-from-sharepoint-discussion-lists-2013?forum=sharepointgeneral
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How to make separate/individual text frame from one parent frame in indesign with javascript

    Hi all,
    Please suugest - how to make separate/individual text frame from one parent frame in indesign with javascript.
    Thanks
    Rohit

    @Larry – ah, your interpretation could be the right one…
    May I rephrase the question:
    "How to split threaded text frames to single ones?"
    "SplitStory.jsx" or "BreakFrame.jsx" under Scripts/Samples indeed could be the answer.
    From the comments in the code of "BreakFrame.jsx":
    //Removes the selected text frame (or text frames) from the
    //story containing the text frame and removes the text contained
    //by the text frame from the story.
    //If you want to split *all* of the text fames in the story, use the
    //SplitStory.jsx script.
    Uwe

  • How to make a pattern in illustrator from a placed image ?

    how to make a pattern in illustrator from a placed image ?

    Just embed the image and make a swatch of it.

  • How to make the audio track independent from the video track?

    Can someone remind me how to make the audio track independent from the video track? My memory just went blank. Must be the age.
    Thanks

    Hi -
    Select the clip in the timeline.
    Type Command + L or go to the menu Modify > Link to toggle it off.
    MtD

  • Java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : Failure in SDOSerializer.deserialize

    Hi All,
    I am getting this exception while invoking one of our service from EM. Any pointers will be very helpful.
    java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : Failure in SDOSerializer.deserialize. at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:813) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:385) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:303) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.el.parser.AstValue.invoke(AstValue.java:187) at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297) at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53) at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1491) at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:111) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:384) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:114) at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:101) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:111) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:384) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:114) at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:95) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:972) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:439) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.sysman.emSDK.license.LicenseFilter.doFilter(LicenseFilter.java:102) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:211) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:131) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:447) at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:447) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.help.web.rich.OHWFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.sysman.emas.fwk.MASConnectionFilter.doFilter(MASConnectionFilter.java:41) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:181) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.sysman.eml.app.AuditServletFilter.doFilter(AuditServletFilter.java:183) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:203) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.sysman.core.model.targetauth.EMLangPrefFilter.doFilter(EMLangPrefFilter.java:158) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.sysman.core.app.perf.PerfFilter.doFilter(PerfFilter.java:141) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:542) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460) at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103) at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.security.wls.filter.SSOSessionSynchronizationFilter.doFilter(SSOSessionSynchronizationFilter.java:419) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:61) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3739) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3705) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2282) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2181) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1491) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) Caused by: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : Failure in SDOSerializer.deserialize. at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke(DispatchUtil.java:362) at oracle.sysman.emSDK.webservices.wsdlparser.OperationInfoImpl.invokeWithDispatch(OperationInfoImpl.java:1004) at

    Hi,
    its JDeveloper and ADF on this forum. For EM related questions, you should try the EM forum
    Frank

  • How can i dispaly an Error Message from Server Side To form

    Hi All,
    How can i dispaly an Error Message from Server Side To form side .
    i try several ways nothing succed.
    i put the error in stack and after call the procedure from form i added
    Qms$Trans_Errors.Display_Messages;
    and because it is an error not informantional error the error screen displayed and enter
    in infinite loop acts like flashing .
    can any one help me please i use C/S Headstart6i and Designer 6i
    thanks alot
    radi

    hi,
    thanks alot lauri.
    yr code work only using information message but in error message its still the same .
    the error window still flash and enter in infinite loop of executeing the same triggers.
    thanks again
    radi

  • How does one remove only one msg from messages?

    How does one delete just 1 msg or reply in Messages without deleting ALL?

    Dschro7561 wrote:
    Thanks but the problem was there was no trash icon. Shut phone down and rebooted and the trash icon came back. Don't know how long it will stay.
    Probably for a long time.  Occasionally, there will be a hiccup or a glitch, and closing then reopening the app usually fixes it.  If not, then a restart or a reset might.  After that, you may need to reset settings or try further troubleshooting.  In the worst case scenario, you can always make a backup then restore the backup, since the restore process acts as a 'filter', or even restore as new and test your issue.
    Basic Troubleshooting Steps when all else fails
    - Quit the App by opening multi-tasking bar, and swiping the App upward to make it disappear.  (For iOS 6, holding down the icon for the App for about 3-5 seconds, and then tap the red circle with the white minus sign.)
    - Relaunch the App and try again.
    - Restart the device. http://support.apple.com/kb/ht1430
    - Reset the device. (Same article as above.)
    - Reset All Settings (Settings > General > Reset > Reset All Settings)
    - Restore from backup. http://support.apple.com/kb/ht1766 (If you don't have a backup, make one now, then skip to the next step.)
    - Restore as new device. http://support.apple.com/kb/HT4137  For this step, do not re-download ANYTHING, and do not sign into your Apple ID.
    - Test the issue after each step.  If the last one does not resolve the issue, it is likely a hardware problem.

  • How to make Mail stop marking messages from my Contacts as Junk?

    I use Mail to access both my Gmail and Mac mail. Mail has begun marking as Junk messages from my Contacts, including VIPs. In Preferences, I have checked the boxes to have Contacts and Previous Recipients exempt from email filtering, yet they still sometimes end up marked as Junk and sent to the Junk folder. These are all Gmail messages: I use my iCloud account very little. I've unchecked the Trust junk mail headers... and Filter junk mail before applying my rules. I don't see how to make Mail leave my Gmail alone! Can anyone help?

    Google recommends turning off Apple mail Junk filters if using gmail filters.

  • How to make a call  to service from site studio templates?

    Hi,
    May be this is very basic but I am not able to figure out how to make a call to a service from site studio templates (hcsp). I have seen one example of service call in the dynamic list fragment. It makes a call to SS_GET_SEARCH_RESULTS service using executeService() method. But it doesn't take any parameters and also not very how returned results are captured.
    I want to execute WCM_PLACEHOLDER service. It takes 2 main parameters dataFileDocName and templateDocName. The returned result is typically a html response.
    The service typically is executed using http request and the url would be something like this
    http://hd-pratapm/ucm/idcplg?IdcService=WCM_PLACEHOLDER&dataFileDocName=VIRTUSAINC&templateDocName=DETAILS_REGION_TEMPLATE
    I think SS_GET_SEARCH_RESULTS service works in the similar fashion. I want to execute WCM_PLACEHOLDER service too using executeService() method. How to work with this? How can we pass parameters and capture returned results?
    Regards,
    Pratap

    Hey Pratap,
    If you are on a standard Site Studio template (page or subtemplate) you should be able to call the wcmPlaceholder idoc function directly. In fact calling the idoc function provides a lot more functionality then the service call (they locked down a few things in the service call since it is designed to be called from an external application).
    The idoc call would look something like: <!--$wcmPlaceholder("Sales", "placeholderDefinitionDocName=placedef_salescontact")--> (taken from page 208 in this doc: http://download.oracle.com/docs/cd/E10316_01/SiteStudio/10gr4/Pdf/Site_Studio_10gR4_Designer_Guide.pdf)
    As a general note when you are in idoc script and want to execute a service you call <$executeService()$> as you saw in the dynamic list. The parameters that the service runs on are in the data binder of the current request. To set parameters for an execute service you simply set idoc variables on the page before it. Example:
    <!--$QueryText="dDocType <matches> `Document`" -->
    <!--$executeService("GET_SEARCH_RESULTS")-->
    As for the response when you execute an idoc function, like wcmPlaceholder, that returns a String the response is immediately output to the page in the location you called the function. This would be similar in concept to a jsp scriptlet that outputs a string <%=myResponseString%>
    Hope that helps,
    Andy Weaver - Senior Software Consultant
    Fishbowl Solutions < http://www.fishbowlsolutions.com?WT.mc_id=L_Oracle_Consulting_amw_OTN_ECM >
    Edited by: Andy Weaver on Jul 7, 2010 7:59 AM
    Added response detail.

  • How to make a self-playing DVD from FCP project of 75 minute film.

    A Quicktime film has been made in Final Cut. It is about an hour and 15 minutes long. It needs to end up on a self-playing DVD.
    Maybe this is a question for the FCP boards (or for DVD SP, which I don't know well): What's the approach to get this project to DVD?---having it look best on the DVD. Are there compression best practices?

    Or you may be able to make a Kiosk mode DVD from a QT file / folder using iDVD. (btw ...I've done this successfully thru iDVD6 but I have not yet tried it under iDVD08):
    http://discussions.apple.com/thread.jspa?messageID=4764361&#4764361
    Please note that this approach is the only way I know of to make a DVD (w/in iDVD) that plays by itself and with no menu whatsoever. Hence the DVD will always play in a continuous loop until you press stop or eject on the remote. Or if you prefer you can also use Roxio Toast which has a similar feature.

  • How does Oracle client communicate with a database server

    Looking to idenify how Oracle Database Client for OpenVMS communicates with database server and whether the protocol used is secure. Realize that it is using whatever the configured network protocol is (ie. tcpip) but is languauge it uses ( ie. SQL, etc..)  secured/encrypted and if not what steps can be taken to encypt

    Arizuddin wrote:
    I have installed oracle client 10g on client pc for getting connection to Oracle databse 10g (runng on windows server) usng ODBC through SAGE ACC PAC (ERP). Working fine earlier. Now all of a suddent user starts complaining about database connection. When checked his pc registry values. Two values of ODBC keys are reset to null. Those are DSN and DRIVER values. How come this values reset to null? What is causing this to reset?Nothing in this has anything to do with the sever. You need to check what the client did on his machine that caused registry to get modified?
    How does oracle ODBC works with Oracle database? Need to know all the steps involved?The connectoin from any client is initiated by a client process. This client process is supposed to get a server process to do his work. So if this is done, the client can work now with oracle . Please see the concepts guide for the gory details of the entire process.
    HTH
    Aman....

  • How to make servlets reloadable in iplanet web server in solaris??

    hi all,
    does anyone know how to make servlets reloadable in iplanet ??? Thanks for help

    Hi there,
    I think your question is about "Dynamic Class Reloading", also named as Hot deployment. and the following lines may be helpful.
    iAS 6.0 SP3 and later version supports new hot deployment features through dynamic class
    reloading of EJBs.By default, dynamic servlet, EJB and registered JSP reloading is disabled in iPlanet Application Server.
    To enable dynamic reloading of servlets, EJBs and registered JSPs, perform the following steps:
    1.Start iPlanet Registry Editor, kregedit, and modify the Disable value under the Versioning key:
    SOFTWARE/iPlanet/Application Server/6.0/CCS0/SYSTEM_JAVA/Versioning
    2.Set the Disable value to 0 (By default, the Disable value is set to 1)
    3.Restart iPlanet Application Server to enable the change
    To hot deploy your application, simply compile and replace the file in the appropriate directory or, use iasdeploy to redeploy
    applications.
    I recommand you to check out the iAS's release notes (http://docs.iplanet.com/docs/manuals/ias/60/sp3/rn_sp3.html#20766) for more infomation.
    Good luck
    Shen Jie
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

Maybe you are looking for

  • I am locked out of my ipod touch help

    Hey guys i need help i am locked out of my ipod and i cant remeber my password can you please help me

  • Print out tickets

    Can i have customers to print out a ticket after having booked and paid an event? Or can I use vouchers or any other kind of downloadable thing as a ticket? Want to avoid sending tickets to customers per mail.

  • Bold text in linux... And formatting output in linux console

    Hello everyone, I was wondering if there is a library of some sort that allows you to print text to the user but in bold or coloured or something like that? Thanks, Gary.

  • Keeping tags while upgrading to elements 10 and Windows 7

    This is a multiple upgrade.  My old 8 year old desktop computer is running XP and Elements 9.  I need to transfer my pictures to my new notebook computer running Windows 7 Home Premium 64 and at the same time I decided to upgrade to Elements 10. I tr

  • An Additional plea for HELPPPPP, trying to import HDV files from a disc.

    A co-worker of mine has copied HDV files of an event onto a DVD as a .mov file. When I import them into FCP it has a red line above the clip indicating it needs to be rendered. When I try to render it, the progress box blinks on then off and it doesn