Advice on client server apps

Hi
i would like to discuss some ways to help improve the connection between a mobile device and a remote server using sockets and http connection.
on my N95 device and on T mobile network, i sometimes struggle to connect to the remove server and was wondering if there is a way to improve this.
would using UDP be ideal has i have heard from someone that TCP is generely not good for wireless connections. what wil be the best approach to improve the perfiormance of wireless devices communicating with a remote server? thanks

hi. first and foremost, both tcp & udp need internet connection irrespective of there modes of operations. tcp is connection oriented since the server has to be in constant communication with the client due to acknowledgement issues while udp does not need acknowledgement. now according to my experience the whole issue is with the cellular service provider companies; they need to make their networks efficient. in my country the internet just stops being there for some several minutes before it resumes and under such circumstances i think both tcp and udp are bound to affected.

Similar Messages

  • Lotus Notes Client Server Apps

    I'm wondering if anyone has tried to connect to lotus notes client server apps. from portal. I've heard that they have to be "webified" first. Is that true or are there different ways to get to the lotus notes app?

    Hi,
    Please post this on PDK forum.
    Thanks,
    Sharmila

  • How to design socket client-server app for 2-way communication

    Hi, I am writing a client-server application. I have a single server and many clients. Each client will need the ability to send information to the server at any time. The server will also need the ability to send information to a client at any time. Its this second part that I am not sure how to design. Would I need to create a SocketServer on each client to accept incoming messages, or is there a better way? Thanks

    scranchdaddy wrote:
    Don't my requirements sound a lot like an IM application, where a chat server might need to send a message to a chat client at any time?Not really. If that is what you are designing
    in my opinion one could easily be forgiven for thinking you were deliberately obfuscating your goal...
    How does the server know where the client is? Does it know the IP address of the client?I would imagine the server would contain a directory of IPs? I'm not sure.
    What happens if the client is not running?Then I guess the message would not get delivered.
    What happens if the client is behind a firewall that does not allow incoming connections?How do IM chat clients work? How have people solved this in the past?Typically the server would only care about clients currently connected to the server.
    Maybe you should re-think your design. I don't really have a design, just requirements, that's why I'm writing this post.Your subject says "+How to *design* socket client-server app for 2-way communication+".
    Are you saying you expect someone else to do the design for you?

  • OSX: multi client server app with NSNetService

    hello
    i have a small osx server app
    that uses NSNetService to manage connection and set up streams
    but it seems to stop advertising as soon as a clients connects
    how can i make it multiclient so it keeps advertising and when a new client connects uses the same streams ?
    thanks in advance
    nonnus

    superdeportivo wrote:
    Hello fellahs, as the title of this post says I'm making a client and server application. The server are supposed to handel several clients, and the communication is done true UDP. Out of interest why have you chosen UDP rather than TCP?
    I have got two questions concerning this. The first one is if a exception is throws in the server should I then send the exception back to the client in serialized form. If I choose to do this then I also would need to handel the exception classen to the client. Or should I send back a regular IOException and use it's init cause to define the exception which occured in the server. That is up to you, you can do either. I would do the first option.
    The second question is concerning the multi client support. If this is going to work then I would need to time-out the connection i the server environment, and I have not a clue about how long it should be?It should be long enough that you don't timeout a valid connection. There is no simple answer to this.

  • Creating chart in java client/server app.

    Currently, I'm developing a client/server java app. under windows. I want to create a chart (pie, bar) for graphically reporting, anybody can help me pls........? Thanks a lot
    TriAK

    There are some solutions...You can use the Java Chart() class or BarChart() from the J2sdk API.
    (http://java.sun.com/applets/jdk/1.4/demo/applets/BarChart/example1.html)
    Besides, you can use some already build class from some companies like ObjectPlanet.(www.objectplanet.com).
    There is also another link(have a look at it) http://www.java4less.com/charts_e.htm
    Another way is to build by your own using java.awt(It will be to most difficult in the manner of time consumed).
    Finally, I will recommend you to create charts as html page integrate this application as Applet or html in general(Javascript,JSP).
    I hope I gave you some ideas.

  • Integrating DOS/client server apps through portal

    Is there any partners out their that have developed any portlets that will integrate legacy client server or DOS through the portlet in a Citrix NFuse fashion?
    There seems to be a few competitive portal providers out their who claim that this can be done. OBTree does this via Java wrapped emulation software which can be integrated over the web.
    This would be very useful for legacy integration into one place without rewriting a front end etc.
    Any ideas or recommendations?

    Any one got idea how to resolve this problem. We are facing this problem with applet based applications. Pleae let me know if any one know how to write netlet rules to make this app. work through portal.

  • Authetication problem in client/server app

    I am presently developing a client/server program, and I'm wondering what will be the best form of authentication. I plan to develop a protocol for the programs, any deviation leading to socket closure. I thought about signatures, but I don't think any body's ready to vouch for me(ie I don't know how to go about signatures). Is there any help?

    Learn about JAAS

  • Help Needed With Basic Client/Server App

    I was wondering if anyone can help with a simple blackjack client/server application i've been writting (basically its a moddified chat application). The problem i'm having seems to lie within the connection management i've written.
    What i'm trying to get is that only 4 players can connect at one time and that each player takes a turn (which i've implemented using threads) to play their hand (as you would if you were playing it for real). The problem is that it will allow the players to connect, but oddly enough, it will not allow a new transaction to be created (i.e. allow a player to take their turn) until 2 players have connected.
    Even when it does create the transaction, after taking input from the client once, the server seems to stop doing anything without any error message of any kind.
    Its really annoyed me now, so you guys are my last hope!
    The code can be found in full here:
    Client Application: http://stuweb3.cmp.uea.ac.uk/~y0241725/WinEchoClient.java
    Server Application: http://stuweb3.cmp.uea.ac.uk/~y0241725/ThreadServer.java
    Card Class: http://stuweb3.cmp.uea.ac.uk/~y0241725/Card.java
    Deck Class: http://stuweb3.cmp.uea.ac.uk/~y0241725/Deck.java
    Please feel free to play around with this code as much as you feel necessary!

    (one last bump back up the forum before i give up on this completely)

  • Making a Client & Server app with UDP

    Hello fellahs, as the title of this post says I'm making a client and server application. The server are supposed to handel several clients, and the communication is done true UDP.
    I have got two questions concerning this. The first one is if a exception is throws in the server should I then send the exception back to the client in serialized form. If I choose to do this then I also would need to handel the exception classen to the client. Or should I send back a regular IOException and use it's init cause to define the exception which occured in the server.
    The second question is concerning the multi client support. If this is going to work then I would need to time-out the connection i the server environment, and I have not a clue about how long it should be?
    /thanks in regards Ali.

    superdeportivo wrote:
    Hello fellahs, as the title of this post says I'm making a client and server application. The server are supposed to handel several clients, and the communication is done true UDP. Out of interest why have you chosen UDP rather than TCP?
    I have got two questions concerning this. The first one is if a exception is throws in the server should I then send the exception back to the client in serialized form. If I choose to do this then I also would need to handel the exception classen to the client. Or should I send back a regular IOException and use it's init cause to define the exception which occured in the server. That is up to you, you can do either. I would do the first option.
    The second question is concerning the multi client support. If this is going to work then I would need to time-out the connection i the server environment, and I have not a clue about how long it should be?It should be long enough that you don't timeout a valid connection. There is no simple answer to this.

  • Client/Server apps using custom objects

    I have wrote an ip transaction server and I am trying to pass objects across to it that don't have to reside on the server. I have created an interface that implements serializable and then the class I am trying to pass implements the interface. I read that as long as the interface is on both the client and the server that the object doesn't need to be using this approach.
    I, however, keep getting a classdefnotfound error for the custom object when I do a readObject().
    Can this really be done?
    Thanks in advance.
    Relevant code snippets:
    interface Workable implements java.io.Serializable
         public abstract int getToWork();
    public class test1 implements Workable
         public int getToWork()
              System.out.println("Test 11 value = ");
              return 1;
    Server code:
    Workable ipdata;
    ipdata = (Workable)in.readObject();//Blows up trying to read object here
    ipdata.getToWork();

    Take a look at the thread on this newsgroup named:
    deserialization loads classes more eagerly than construction?
    That seems similar to your complaint (Java's object serialization not conforming to its own specs about "classes that don't need to be present", in that thread it is a non-serializable member object that blocks things). I get the feeling you hit a bug in Java's serialization mechanism and that it is caused by a faulty heuristic in Java serialization.

  • Using Class Timer  in a client/server app

    In my program i d like the server execute draws every 5 min choosing numbers randomly from1 to 10.
    Clients, when connected will inform server about the number they chose. (This works correctly)
    Next, the clients will wait until notified by the server about the number drawn in the last draw and
    about if they won or not.
    i ve found that i have to use classes Timer and TimerTask but API does not help me enough
    about how to use them. Could anyone help me?
    Here is the piece of code i think it need to be changed.
      // control thread's execution
          public void run()
             int message=0;
             int rnum=randGen.nextInt(10);
             display.append( "\n"+ "THE MAGIC NUMBER IS: " + rnum );
    // process connection
             try {
                // read message from client
                do {
                   try {
                      message =  input.readInt();
                      if (message==rnum){output.writeUTF("SERVER>>> YOU WON: MAGIC NUMBER IS: " +rnum);}
                       else {output.writeUTF("SERVER>>> YOU LOSE: MAGIC NUMBER IS: " +rnum);}
                      display.append( "\n\n" +"PLAYER " + clientNumber + " SELECTED NUMBER " + message );
                      display.setCaretPosition( display.getText().length() );
                   // process problems reading from client
                   catch ( IOException ioException ) {
                      display.append( "\nUnknown object type received" );
                } while ( message!=-1 );
                display.append( "\nClient terminated connection" );
                display = null;
             // close streams and socket
             finally {
                try {
                   output.close();
                   input.close();
                   connection.close();
                // process problems with I/O
                catch ( IOException ioException ) {
                   ioException.printStackTrace();
                clients.remove( this );
          }  // end method run
        

    I just implemented something like this so I know what you are trying to do.
    Basically TimerTask is an Abstract class, which means you can't make an instance of it. So TimeTask t = new TimeTask() won't work. Instead what you need to do is make your own class that extends TimerTask. You then need to implement the run() method which is abstract in TimerTask.
    This sounds complicated at first, but it is very easy.
    This is my DelayTimerTask:
    import java.util.TimerTask;
    *Author: Jon Parise
    *email: [email protected]
    public class DelayTimerTask extends TimerTask{
        private boolean timeExpired = false;
        /** Creates a new instance of DelayTimerTask */
        public DelayTimerTask() {
            timeExpired =false;
        public void run(){
            timeExpired =true;
        public boolean isExpired(){
            return this.timeExpired;
    }All this class does is set a flag when it is run.
    The Timer class schedules a TimerTask, in this case a DelayTimer. When the scheduled time comes, everything in run is executed, which in this case sets the flag.
    To schedule the task do this:
    Timer delayTimer = new Timer();
    DelayTimerTask delayTimerTask = new DelayTimerTask();
    delayTimer.schedule(delayTimerTask,5000);
    while(!delayTimerTask.isExpired()){
         //DoSomething Here
    }This will create a new delayTimer, and then schedule it to go off in 5 seconds(5000 millaseconds). When it goes off isExpired will become true and break you out of the loop.
    Hope this helps,
    Jon

  • Need xp performance tool to monitor client-server apps

    My Xp/Oracle 61 forms are causing the application to "stall" when many images are displayed. I need a tool that tells me what threshold is hit- to at least point me in the right direction. Is it memory, cpu, graphics cards, what? The XP supplied performance tools are not satisifactory. I need something that is a little more telling. Tell me Oracle, or users who have been where I am going , what is a good tool to isolate the "real" problem?

    Check out Process Explorer:
    http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/ProcessExplorer.mspx

  • Client/server RMI app using Command pattern: return values and exceptions

    I'm developing a client/server java app via RMI. Actually I'm using the cajo framework overtop RMI (any cajo devs/users here?). Anyways, there is a lot of functionality the server needs to expose, all of which is split and encapsulated in manager-type classes that the server has access to. I get the feeling though that bad things will happen to me in my sleep if I just expose instances of the managers, and I really don't like the idea of writing 24682763845 methods that the server needs to individually expose, so instead I'm using the Command pattern (writing 24682763845 individual MyCommand classes is only slightly better). I haven't used the command pattern since school, so maybe I'm missing something, but I'm finding it to be messy. Here's the setup: I've got a public abstract Command which holds information about which user is attempting to execute the command, and when, and lots of public MyCommands extending Command, each with a mandatory execute() method which does the actual dirty work of talking to the model-functionality managers. The server has a command invoker executeCommand(Command cmd) which checks the authenticity of the user prior to executing the command.
    What I'm interested in is return values and exceptions. I'm not sure if these things really fit in with a true command pattern in general, but it sure would be nice to have return values and exceptions, even if only for the sake of error detection.
    First, return values. I'd like each Command to return a result, even if it's just boolean true if nothing went wrong, so in my Command class I have a private Object result with a protected setter, public getter. The idea is, in the execute() method, after doing what needs to be done, setResult(someResult) is called. The invoker on the server, after running acommand.execute() eventually returns acommand.getResult(), which of course is casted by the client into whatever it should be. I don't see a way to do this using generics though, because I don't see a way to have the invoker's return value as anything other than Object. Suggestions? All this means is, if the client were sending a GetUserCommand cmd I'd have to cast like User user = (User)server.executeCommand(cmd), or sending an AssignWidgetToGroup cmd I'd have to cast like Boolean result = (Boolean)server.executeCommand(cmd). I guess that's not too bad, but can this be done better?
    Second, exceptions. I can have the Command's execute() method throw Exception, and the server's invoker method can in turn throw that Exception. Problem is, with a try/catch on the client side, using RMI (or is this just a product of cajo?) ensures that any exception thrown by a remote method will come back as a java.lang.reflect.InvocationTargetException. So for example, if in MyCommand.execute() I throw new MySpecialException, the server's command invoker method will in turn throw the same exception, however the try/catch on the client side will catch InvocationTargetException e. If I do e.getCause().printStackTrace(), THERE be my precious MySpecialException. But how do I catch it? Can it be caught? Nested try/catch won't work, because I can't re-throw the cause of the original exception. For now, instead of throwing exceptions the server is simply returning null if things don't go as planned, meaning on the client side I would do something like if ((result = server.executeCommand(cmd)) == null) { /* deal with it */ } else { /* process result, continue normally */ }.
    So using the command pattern, although doing neat things for me like centralizing access to the server via one command-invoking method which avoids exposing a billion others, and making it easy to log who's running what and when, causes me null-checks, casting, and no obvious way of error-catching. I'd be grateful if anyone can share their thoughts/experiences on what I'm trying to do. I'll post some of my code tomorrow to give things more tangible perspective.

    First of all, thanks for taking the time to read, I know it's long.
    Secondly, pardon me, but I don't see how you've understood that I wasn't going to or didn't want to use exceptions, considering half my post is regarding how I can use exceptions in my situation. My love for exception handling transcends time and space, I assure you, that's why I made this thread.
    Also, you've essentially told me "use exceptions", "use exceptions", and "you can't really use exceptions". Having a nested try/catch anytime I want to catch the real exception does indeed sound terribly weak. Just so I'm on the same page though, how can I catch an exception, and throw the cause?
    try {
    catch (Exception e) {
         Throwable t = e.getCause();
         // now what?
    }Actually, nested try/catches everywhere is not happening, which means I'm probably going to ditch cajo unless there's some way to really throw the proper exception. I must say however that cajo has done everything I've needed up until now.
    Anyways, what I'd like to know is...what's really The Right Way (tm) of putting together this kind of client/server app? I've been thinking that perhaps RMI is not the way to go, and I'm wondering if I should be looking into more of a cross-language RPC solution. I definitely do want to neatly decouple the client from server, and the command pattern did seem to do that, but maybe it's not the best solution.
    Thanks again for your response, ejp, and as always any comments and/or suggestions would be greatly appreciated.

  • JavaFX as a SaaS/ How good is it for Client-Server work?

    I was under the impression that FX could be used to produce a Client-Server application as well as SaaS.
    a member of another forum said "I'm sure you meant to say "Desktop". JavaFX will not be making inroads on the web as a client-side technology."
    To which I said
    There have been examples of FX used with EE
    http://www.oracle.com/technetwork/java/javafx/samples/index.html
    http://docs.oracle.com/javafx/2/overview/jfxpub-overview.htm
    Sales Dashboard (DataApp)
    DataApp is a client-server application for a fictional global automobile company called Henley Car Sales. Automobile sales are simulated on an EJB server using JavaDB, and the data is available via Derby and a RESTful web service. The client demonstrates a variety of data presentations by using a mix of FXML and JavaFX.
    I thought originally that JavaFX was "Desktop" only also, until I found this example. I couldn't get it to run due to some weird Database line read issue that others also had. I'm not sure if this is now due to FX's integration, or if this was something new, but I believe I have seen another FX client-server app as well.
    I'm not that familiar with the client-server side of Java yet, so if you have other Information I would like to know, because I am looking to design a Client-Server app with FX, and I don't see why it would be an issue, unless there are huge limitations."
    He ended up saying "Those are still desktop apps. Sure, they are client-server in that they connect to a remote database. But they are still traditional fat-client apps rather than web-based thin-client SAAS web applications which, these days, most people will think of when you say "client".
    My point is to be more precise when you use the word "client".
    But if your point is just that JavaFX is taking over from Swing for the limited areas in which Swing is used, I have no insight into that area."
    Now I don't really like attitudes when I get my question answered, but the high and mighty needs to stop. It clearly says Client-Server so I don't know why it's being denounced by this dude who thinks he obviously knows better.
    Anyways he talks about it only being able to connect to a DB, to which it says it uses EE tech such as EBJ, Restful, and Derby, so that's more than just DB right(I don't know since I havent' learned that yet)?
    It seems as if he's saying that only EE code can go up on a server? Or can SE code go up there as well?
    I'm looking to design a SaaS software with FX, so if this isnt' possible I would like to know possible other options(or just having all of the gui work on the client, and the rest on the backend)???
    Thanks!
    ~KZ
    Edited by: KonradZuse on Apr 30, 2013 11:26 AM

    This response is not a tutorial, I hope it gives you some verbiage to use in further searches.
    SaaS to me means that the service is running on the server. If you have the server and permission to run java apps there then you can use Java FX by having the server shuttle requests to the Java FX app. But this is probably not the intent of Saas (it would be more appropriate to use a java implemented web service).
    If you are using Netbeans then it is very easy to create demo projects; use "File/New Project" to run them on your local computer.
    Example File/New Project/Java Web/Web Application will give you a hello world web site very quickly. This will 1) start either tomcat or glassfish as the server. 2) launch an html page with "hello world". then you can use java script to talk with the server via ajax. Using this approach you are going to need to study JSP or J2EE stuff.
    After this is running you could start one of the Java Fx examples in Netbeans: File / New Project / Samples / WebViewBrowser. This will start a javaFX app that acts like a browser and runs on the client.
    So, start the "hello world" app in netbeans by right clicking it in the project pain and selecting "debug". Then start the webviewBrowser app the same way to load that web page that has "hello world" in it as all browsers do. In the WebviewBrowser (which is java fx) you can get at the javascript in the web page and do all kinds of stuff. You'll need to search for webviewBrowser examples.
    The above all assumes a Netbeans solution. But, as you probably know, there are no rules. The server can be in C++ and the client in C (or any other language). The server and client usally communicate via http or tcp. So you could have a server written in java (maybe J2ee or you can rewrite a http server from scratch which isn't that hard - search for "HttpServletRequest and HttpSession" ) and the client can be in Java FX (where the Java FX talks directly with the server via http (no javascript or web page in the middle) again there are probably hundreds of libraries to talk to a http server).
    I use HttpServletRequest and HttpSession on the server side with MySQL and xml. On the client I use javaScript but I am moving to a strictly Java FX solution. This will give me close to 100% java on both sides and for my purposes this will work. (I may need a little html in the middle for drag and drop installation.) I am hoping that work continues with porting Java FX to most devices: Android, IOS, WinPhone. It is already on Linux, Windows Desktops and Mac.
    Edited by: KevinPas on May 1, 2013 9:50 AM
    Edited by: KevinPas on May 1, 2013 9:56 AM

  • Tips for Client-Server project please...

    I've written a few Java apps (some very simple, some not quite so simple) so far and I think I'm ready to begin tackling my big goal. I want to create a distributable client desktop application that will actually be very simple in functionality. I want the clients to be able to connect to a server (that I will also be creating) for authentication and then allow automated messages to be sent to other clients also connected to the network. I'd like any links to tutorials, libraries, and anything else that would help point me in the right direction. Thanks!

    Actually, if you're on about clients sending messages to each other, then you're not really talking about client-server apps at all. You're veering off into JMS territory, maybe even ESB territory(but probably not). Have a butchers at ActiveMQ, and Camel, both from Apache, for that.
    Either way, I wouldn't bother creating your own server, just use an existing one. Jetty's nice and lightweight, and easy to embed. You're about to say "I'd rather create my own" but it's a bothersome task that people far more skilled than you (and me, before you take offence) have already done much better than you ever will. Take advantage of that fact, and concentrate on the specifics of your own app.

Maybe you are looking for

  • *Access to Portal Via Company Website*

    Our company has a website running on oracle which I am addressing here as legacy portal. The employee data is maintainted in SAP and we have recently implemented ECM which is currently being performed through the SAP portal. We want to introduce the

  • Cannot purchase Music From iTunes Store

    Hi, I have an iMac indigo running OS X 10.2.3 and iTunes 4.7.1. I recently drank 5 bottles of coke and entered the promotion codes into the iTunes store to get my 5 free songs. My account registered that I had 5 song downloads available. I went to ch

  • T40/Vista: Fn+F5 can't turn Wifi On/Of

    After upgrading to Vista on my T40 (2373-92G) I can't turn the wireless antenna on/of with the Fn-F5 keys. It only toggles the Blutooth on/off. How can I restore this function? /Jan

  • Add image to Table cell

    Hi All,    Based on condition how can i add image to Table cell.

  • How to install windows on macbook pro me294 using downloaded drivers?

    Recently I bought a MBP and I'am going to install windows on it because of my job. I have a problem with bootcamp assistant: I have downloaded the bootcamp drivers but when I am creating the setup disk it automatically chooses to download the drivers