Client server basic question

I have a web service that returns byte arrays to the client. First a byte array is returned and the server gets the acknowledgement, then the next byte array is sent and so on. But I don't have much idea how to implement it. How can I resume from where I stopped at the server side? Can anyone give me some idea so that I can proceed?
Thanks.

Thanx for your reply!
So if I have a relatively small number of clients that do a lot of data processing, then the following scenario would be ok to do:
- a (rich) client connects to the J2EE server with some EJB call.
- the server creates a queue for that client and that session.
- the client creates a MessageConsumer for that queue.
- the client sends a message based data request to a server queue.
- a MDB processes that data request and sends a reply message to the clients "session queue"
Would that be ok?

Similar Messages

  • Client server applet question

    Hello I have a client and server program on computer a and computer b.
    I want a webpage with a java applet.
    I want that if I push a button in the client the java applet gets a message.
    I want that the server looks for changes in the applet and when there is a change the server does something.
    I have a program where the client and server communicate with eachother but how can I make a program like I want?
    How can I send a message to the applet(on a webpage) from the client and how can I look at the applet with my server??

    Aplet runs on client side (in other words on PC which is used to view page). On server side it is stored only as any other kind of file. To be able to create "client-server" solution you have to be able to run code also on server machine. I did not found any free hosting server which allows to run java. But in many cases they allow to use PHP which runs enteirly on server side. Check for this - it may be right solution for you.

  • Client/Server application question

    Hey everyone,
    I am trying to exercise on a client/server application. My client application is similar to this one [http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/Code/SocketClient.java]. However this client works like this: it sends text through socket -> receive response from server. I am trying to find a way so that the client can receive and process messages from the server asynchronously. That is the server can send messages anytime (not just as a response to the client) and the client should always be able to receive messages from the served at any time, and not just after it sent something. I believe that multithreading would be the answer, listening to the output stream and sending through the input stream should be run in parallel, but I can't find a way to implement it. Your help is appreciated. Thank you.

    I knew that :-) but how exactly?
    How do I translate this code into two runnable classes which will communicate with the original class and its gui?
    //Send data over socket
              String text = textField.getText();
              out.println(text);
           textField.setText(new String(""));
    //Receive text from server
           try{
           String line = in.readLine();
              System.out.println("Text received :" + line);
           } catch (IOException e){
          System.out.println("Read failed");
                 System.exit(1);
      }

  • Lion server, basic questions

    HI,
    I have three questions :
    1.  If I install Lion server on my desktop iMac, can I exchange files or document from my Macbook Por from my school.  Before I was ablle to do it in ftp, now how is it work ?
    2.  Is my Time Capsule is sufficient for routeur ? I mean, do I have to put my Time Capsule in bridge position and get a linksys routeur for example for controll the passage to my iMac ?
    3.  I my network, I have a G4 on OSX 10.4, will it be yet possible to acess to my iMac in server mode for it, and will it be posible to access to the G4 from my iMac on Lion server ?
    Thanks,
    Claude

    Thanks for quick response.   Indeed, in hindsight, it appears that they had only installed the Server App, but not the Server Admin tools.
    Unfortunately, I am not a system admin, but I played one on TV <grin>
    All kidding aside ... I'm willing to learn, but would need most of the basics controlled through the GUI ... and then feel comfortable reading up and editting configuration files and running commands from the Terminal.
    On this line, is there good documentation of this, or is this something that you know because you are familiar with Unix?    ie something like the alternate port issue ... is this something in the GUI, or something I would have to edit via Terminal?
    Just trying to make an informed decision before jumping platforms.
    Thanks
    David

  • Client/Server connection question

    I am trying to understand some basic connectivity tricks between Client and Server.
    I saw my friend doing stuffs like, query google.com with certain keywords, and present the return results on another webpage or program using jsp. I have no idea how he did that, and I wonder if anyone here is familiar with such tricks.
    Edited by: ttback on Dec 3, 2007 4:06 PM

    To access a specific search thing you can use URL and URLConnection classes like:
    String search_query; //input it...
    URL url = new URL("http://www.google.com/search?hl=en&q=" + search_query + "&btnG=Google+Search");
    URLConnection urlc = url.openConnection();
    //read from urlc
    //print the result...

  • Client/Server UDP question

    Hi,
    I am writing a server program which both sends and receives UDP messages to various clients.
    What I want to do is both send and receive on the same port. I'd like the receiving to be done on the same thread (and therefore on the same socket). However I'd like the sending to be done in multiple threads (1 per client).
    The problem is, I don't think I can use the same socket object to send to all of the clients. I'm thinking there would be collisions/problems with the multiple threads sending on the same socket.
    However, if I create multiple sockets for sending, and one socket for receiving (all bound to the same port), is there a way to tell the "sending" sockets to only send (i.e., not receive)? Or is this automatically done simply because I never do a socket.receive on those sockets? Or do I need to pick a different port for sending rather than receiving?
    What I want to avoid is listening to the port on my "listen" socket, but having that data show up on one of my "send" sockets (and therefore never seen, because I don't do a socket.receive()).
    I've looked in the forums/tutorials for this, but nothing I've seen addresses needing to send from multiple threads, or needing to have listening on a separate thread (which I need to do to prevent having the receive() block the send()). Please bear with me if this is a stupid question; I'm new to network programming, especially UDP.
    Any help would be greatly appreciated!

    it shouldn't be a problem to send from multiple threads and receive on another thru the same UDP socket. If you want to send from a different socket, that's fine too... except that the other side will need to know to send responses back to your receiving socket (port) and not the "source" of the packets they receive.
    I'm not sure you can mark the socket for send or receive only, but it really doesn't matter. Just don't read from the sending one or write to the receiving one. An incoming packet isn't going to block an outgoing packet, or an outgoing packet isn't going to push an incoming packet out of the way. The pipe analogy for socket connections isn't so literal like a real pipe where water could only really go one way.
    It's the threads that would block on while waiting for input, which is why you need separate threads, but not necessarily separate sockets.

  • Client Server Socket question!

    Hello all,
    how are ye.
    I would like to ask a question.
    I would be graterful for any suggestions relating to my query.
    i am creating a program that needs to communicate over a network
    it has two parts
    P1) sends request to the other program mainly about account information and
    also updates.
    P2) the second part among other things listens for messages on a port from Program One.
    but also must be able to interface with the user who is using Program Two, the user should be able
    to view account info update delete search etc.
    my problem is how will i get the second program todo both operations do i need
    to create another thread that listens and if i do this. will i be able to
    like add info to a database from this thread.
    Mainly i need suggestion as to how i should implement a scenario like the above.
    I am sorry if i havent spelled out my problem in a clear manner.
    Very grateful for any assistance.
    Thank you all :-)

    http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html
    That should help you out.

  • Help with Client/Server - basic error

    I get the following error message when I try to run the following code - why ?????? Is it something to do with it being run on a networked computer or what ??!?!
    import java.net.*;
    import java.io.*;
    import java.util.*;
    class ClientSimon {
    public static void main (String args[]) throws Exception {
    InetAddress addr = InetAddress.getByName(null);
    System.out.println(addr);
    try {
    Socket s = new Socket("127.1.1.0", 4444);
    } catch (UnknownHostException e) {
    System.err.println("Don't know about host!");
    System.exit(1);
    //////////ERROR MESSAGE FOLLOWS////////////////
    localhost/127.0.0.1
    java.net.ConnectException: Connection refused: no further information
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:312)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
    at java.net.Socket.<init>(Socket.java:273)
    at java.net.Socket.<init>(Socket.java:100)
    at ClientSimon.main(ClientSimon.java:13)

    hello earnshaw1,
    did you run your ServerSocket using port 4444?
    if you indicate a different port then it would definitely yield to the same error:
    -->localhost/127.0.0.1
    java.net.ConnectException: Connection refused: no further information
    try changing the port of your ServerSocket to 4444 and run it first before running ClientSimon..
    hope it helps!
    enjoi!

  • Basic Questions from Prospective Lion Server Switcher

    I have five servers I am running right now using Windows 2003 Server and various 3rd party packages.     Several years ago I became a Mac fan, moved all of my client based stuff to Mac, and now want to start moving my server based equipment to the OSX platform.
    I stopped by my local Apple Store, and they had a version of OSX Lion Server running on a MacMini, but couldn't seem to answer the most basic of questions because as their business people stated "We are not Server Certified" ... they recommended I talk to an outside consultant to get these basic questions answered which seems a little extreme.
    So I'm hoping the group can help.
    (1) I read through most of the Lion Server Advanced Administrative manual.    Lion server appears from the manual to do most of what I need.   However, when I tried doing some of the functions in the manual on the demo Lion Server at the Apple Store, many of the functions I wanted to do did not seemed to either be installed, or their were buttons missing in the Server App.     I do not know if this was a permission level problem, because the account I setup for myself had administrative rights.
    (2) In the mail app, it only appeared you could setup one mail domain.    It appeared you could setup virtual domains and users through the user app, but not through the mail domain itself?
    (3) I could not find any where to enable DNS services.    The manual seems pretty straight forward in turning on DNS, but the Lion Server I saw had no DNS services running, or any way to enable them?
    (4) Same for mailman listserv type function ... manual seems to be straight forward on enabling under the mail server, but again, no signs of the settings or enabling under the mail service.
    (5) Under the mail app, didn't find any way to setup alternative SMTP ports  ( I allow now Port 26 besides the standard Port 25 and SSL ports for my users.) ... I find port 26 gets past most firewalls at hotels etc.      Didn't see any way to control SMTP authentification too.
    (6) Under the Lion Server tech description, it talk about a built in web editor, saw nothing of the kind.
    So did the apple store have a limited install or am I missing something that the lion server manual does not match the capabilities of lion server.
    Love to get a straight answer before purchasing hardware to replace 5 present machines.
    Thank you.
    David

    Thanks for quick response.   Indeed, in hindsight, it appears that they had only installed the Server App, but not the Server Admin tools.
    Unfortunately, I am not a system admin, but I played one on TV <grin>
    All kidding aside ... I'm willing to learn, but would need most of the basics controlled through the GUI ... and then feel comfortable reading up and editting configuration files and running commands from the Terminal.
    On this line, is there good documentation of this, or is this something that you know because you are familiar with Unix?    ie something like the alternate port issue ... is this something in the GUI, or something I would have to edit via Terminal?
    Just trying to make an informed decision before jumping platforms.
    Thanks
    David

  • Question, in a client server implemention

    Question, in a client server implemention using only basic sockets and datagrams, what happens if a method is being called at the server side while the same method is already being called/running for another client?
    Example:
    Client 1 calls Method 1 at Server Side. Method 1 runs.
    Client 2 calls Method 1 at Server Side. Method 1 is still running for Client 1. Does it create another Thread and runs for Client 2? Or do I have to implement a seperate Thread for each Client myself?

    Thanks!
    Don't want to start a new thread so might as well ask this here,
    Is there a way to pass or at least update the value of a variable from the outside into a Thread that is running? And this value needs to be seen and be the same for all Threads.
    I am thinking of creating new a class that to hold the value I want to update, and passing an object of the class in to the Threads before they runs. Since objects hold reference to the location of the actual object or something like that; people always get worked up over this if I phrase this incorrectly, but I think I got the point across, so that's okay. If I change the value of the object at runtime in the main method, like assign it with a new value according to user input. All the Threads will get the new value right?
    Something like that.
    public class valueToUpdate {
    String value;
    public valueToUpdate(String value) {
    this.value = value;
    public String getValue() {  
    return value;  
    public class Main {  
    public static void main(String[] args) {  
    String str = "abc";  
    valueToUpdate vTU = new valueToUpdate(str);  
    ThreadClass tc1 = new ThreadClass(vTU);  
    Thread thread1 = new Thread(tc1).start();  
    ThreadClass tc2 = new ThreadClass(vTU);  
    Thread thread2 = new Thread(tc2).start();   
    public class ThreadClass implements Runnable {  
    valueToUpdate vTU;  
    public ThreadClass(valueToUpdate vTU) {  
    this.valueToUpdate = valueToUpdate;  
    public void run() {  
    System.out.println(valueToUpdate.getValue());  
    }Okay, something like that. I know I need to add in a TimerTask for ThreadClass too for it to run for a certain period. But if I were to ask for user input at the main method while the TimerTask in running, and I change the value of vTU, will the output for both Threads be changed to the value of the user input?
    Or is there a better way to do it?

  • Basic client Server stuff

    Say i have two classes class A and class B. class B is a server that is run on computer (comp1) and then i run class A a client on both Comp2 and Comp3. How do I ,
    Comunicate with the server (class B) on comp1?
    Share variables and other information between comp2 and comp3 by means of classB on comp1
    and how to I properly close the connection after these goals are accomplished.
    If someone could post a good tutorial covering these things or simply explain it themselves it would be greatly appreciated, Thanks for taking the time to look at this post.
    -Dizzixx

    Google is very good at answering these types of questions.
    http://www.google.com/search?q=java+client+server+tutorial

  • Basic Client-Server query

    I'm in the early stages of writing a client-server program. I've got the client and the server communicating (I think). I send text from the client to the server. I then want the server side BufferedReader in to be read into a variable. I've tried doing it using String inputLine = in.readLine() but it keeps throwing an IOException. I can't work out why.
    try {
                PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
                BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
             System.out.println("The printwriter and bufferedreader have been set up.");
                String inputLine, outputLine;
                inputLine = in.readLine();
                System.out.println(inputLine);
            } catch (IOException e) {
                System.out.println(e);
            }The serverSocket and socket have been set up properly as far as I can tell. It's just the above portion of code that seems to be causing a problem. My knowledge of Java is fairly basic at the moment, so any help would be greatly appreciated.

    I agree that jdbc is probably the simplest approach here and it is probably the best introduction to java/database interaction. If you put some forethought into the design then it will also take some time out of transitioning to RMI should you decide to go that route. Is there a reason jdbc won't work for your application?
    Oracle's JDBC download:
    [http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html]
    Oracle JDBC FAQ:
    [http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm]
    You can find lots of tutorials on connecting, querying, etc. via google as well.
    RMI may help keep the client smaller and also gives some flexibility but if these (remote) methods are only going to be used for this application then once again jdbc may be the best choice. If there is a possibility that other applications may use them in the future then it might be a good choice.
    [http://java.sun.com/j2se/1.5.0/docs/guide/rmi/hello/hello-world.html]

  • 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)

  • Forms 6i client/server questions

    Hi, I have three questions:
    1) Is Patch 17 for Forms6i cumulative? (we have patched up to patch 13)
    2) After applying patch 17 do we need to recompile all of our forms?
    3) We are connecting from 6i client/server forms to a 10.1.4 database, is there a recommended Oracle client? (we are very behind and still running a very old version and I'm trying to get information to move forward)
    Thanks.

    Patch 17 is designed for the 10g database. There is no hint, that a 9i-db is better than a 10g. Use 10g.
    I always recompile all (!) libs, menues and forms after installing a new patch. It's better to do that once, than to search for failures, that result from patching.
    try it
    Gerd

  • JMS architecture question for fat client/server.

    Hi. Is JMS suitable for fat client-server architecture where a certain number of fat client applications (like a few hundreds) open connections directly to the JMS provider? Is it going to have scalability problem when the number of connections grow?

    Depending on your JMS provider, this may be a very suitable architecture. The Sun MQ JMS Cluster was architected exactly for this problem. If the number of connections onto a single broker becomes too much of a burden for this broker, it can be put into an MQ cluster and share the number of connections. Of course, the number of connections a broker can handle will be totally dependent on the resources available to it. OS, CPU, memory, other applications running on the same machine, etc....
    TE

Maybe you are looking for

  • How to setup a query plan in effective at any time for SP or SQL query?

    I have a SP which include a group by SQL statement. It retrieve data from a couple of tables which are over 1G size, When I run this SP at first time, it take more than 5 minutes to get the result. then I run it again and again, Finally, it become ve

  • Down pmt clearing through APP

    Dear Friends, Can we clear the vendor down payment automatically?  I mean through APP can we do this? Please give me your inputs Thanks in advnace NMB

  • Continue from Quiz Problem

    For my project, after the end user completes the quiz, when they "Click anywhere to continue" I want the next URL to open in the current window, not a new window. I have established the following settings under Edit/Preferences/Project/Start and End:

  • RRI -  Selection was not Restrcited

    Hi All,    While jumping from BEX report to R/3 transaction MB51 I get this warning stating " Selection was not Restrcited" . What could be the problem? Regards Nitin

  • Nikon D600 raw files

    When will Photoshop Elements 9 and Lightroom 3 support Nikon D600 raw files.