Need HELP in JAVA ( client /server application )

hi there ,
I need the following codes in java for my client/server application . which i can use to perform certain function on another computer on LAN. This is part of my semester project . I would really appreciate if any one can help me
->Open/close the CD-ROM once or in intervals (specified in seconds).
->Swap mouse buttons the right mouse button gets the left mouse button's functions and vice versa.
->Start optional application.
->Play optional sound-file.
->Point the mouse to optional coordinates.
->Shutdown the system, logoff the user etc.
->Mouse can be controlled on the target computer with remote mouse.
->Keys (letters) on the keyboard can be disabled.
->Increase and decrease the sound-volume.
->Listen for keystrokes and send them back to you!
I would really appreciate if some1 can help me find these codes in java
thanx
Alamzaib Shafi
[email protected]

Dude, if you did your own homework once in a while you'd be able to handle your own semester project. I hope you fail your class and get kicked out of the program. One less idiot with a diploma competing with us hackers for the tech jobs.
You are indeed a most worthy recipient of my unemployed angst.

Similar Messages

  • Need help in desigining Client/Server Application using Java

    Hi,
    I am new to Java and no sooner that I started studing it I have been given a project - client server java Application that allows a user to do a property search based on critiras (eg location, price) and display the results. I am stuck because I don't know where I need to start. Have to use IDE (Netbeans or Eclipse) but not sure about dev frameworks.
    Can someone give me an outline of what I should do / where I should start? What will be the best solution?
    Thanks in adance

    http://java.sun.com/docs/books/tutorial/networking/index.html
    That's Sun's networking tutorial series. Live it, learn it, love it. You'll need to decide if you want to use connected sockets or datagrams. You'll need details like, can multiple clients connect simultaneously?
    The tutorials are the first step though.

  • Need help on Java in sound application

    A good day to everyone here,
    I need help on using Java.My project is mainly manipulating WAV sound files with Java. There is some problem.I hope you all can help me. I couldn't find much info about Java in sound manipulating,sample coding or something like that. I need to find the command to
    1) Find each sampling point value in a sound file.
    2) Find the number of sampling point and the average value of the all the sampling point.
    3) Record the sound file in a different bit rate format.
    I dont know how to go about it.I really hope you all can help me, or direct me to any resources that may help me. Your help is very much appreciated.
    Thank you very much....

    i found this coding in a website n i not very sure that i understand it.
    can anyone tell me if i can find the sample point value of a sound file with this coding (byte[] source is byte array of the sound file).
    thanks...for all the help
    public byte[] executeAmplitudeTransformationInternal(byte[]
    source)
    int[] sampleArray = getSampleArray(source);
    int[] newSampleArray = executeTransformation(sampleArray);
    //convert 16 bit samples back to 8 bit byte[]
    return getByteArray(newSampleArray);
    public int[] getSampleArray(byte[] eightBitByteArray) {
    //create an array 1/2 the size (since every 2
    //8bit samples makes 1 16bit sample)
    int[] toReturn = new int[eightBitByteArray.length];
    int index = 0;
    for (int t = 0; t < eightBitByteArray.length; t += 2) {
    //read the high bit
    int low = (int) eightBitByteArray[t];
    //read the low bit
    int high = (int) eightBitByteArray[t + 1];
    //bit shift the high bit 8 bits to the left and
    // "And" the low bit against 255 to drop any
    //sign extended data in the top 8 bits.
    //refer to the tutorial for more clarification
    toReturn[index] = (high << 8) (low & 0x00ff);
    index++;
    return toReturn;
    public byte[] getByteArray(int[] sampleArray) {
    //create a new byte[] twice as big as the sample array
    //because it takes two 8-bit bytes to represent one
    //16-bit sample
    byte[] toReturn = new byte[sampleArray.length * 2];
    int index = 0;
    for (int t = 0; t < sampleArray.length; t++) {
    int sample = sampleArray[t];
    //this places the low byte in the array.
    //the downcasting automatically lops off the high byte
    toReturn[index] = (byte) sample;
    index++;
    //this byte shifts the sample 8 bits to the right
    //this puts the old high byte in the position of the low byte.
    //this way the high byte remains after the downcasating from
    //an int to a byte
    toReturn[index] = (byte) (sample >> 8);
    index++;
    return toReturn;
    public int[] executeTransformation(int[] sampleArray) {
    //create a clone sample array
    int[] newSampleArray = new int[sampleArray.length];
    //apply algo to each sample
    for (int t = 0; t < sampleArray.length; t++) {
    int result = (int) (sampleArray[t] );
    //add the sample
    newSampleArray[t] = result;
    return newSampleArray;

  • Need help with HTTPS Client/Server

    Hi i really dont know much about this topic and i was wondering if any 1 knows where to find a good example program to set up a
    HTTPS Server/Client or at least how to implemnt a HTTPS Client.
    thanks in advance

    URL.openConnection works fine as a client. You don't have to do anything other than specify the protocol as https.
    I don't know what you are looking for in terms of server. Are you trying to write your own server? Which part do you not know? The HTTP part or the S part?

  • I Need Information about  Open Source Java Client/Server Instant Messaging

    I need your valuable help and collaboration with the following issue:
    I need to know where can find a robust Open Source Java Instant Messaging Client/Server Application.
    I thank in advance for their valuable time. And for the attention and the collaboration lent to me.

    I was going to mention that right off, but since the OP is clearly unaware of the search engines on the Web, I thought I'd give him a hand. Jabber works pretty good - I tried it a while back and some of the clients were ... quirky.

  • HELP - problem in running SSLSocket client/server application

    Hi,
    I want to create a SSLSocket based client/server application for this i have used EchoServer.Java and EchoClient.Java files. Both files are successfully compiled and when i ran EchoServer it throws an exception "Server certificate not found".
    I want to make a complete auto-controlled client/server application which will automatically gets certificate and all configuration itself from program because i will use both client and server application in as a servlet part.
    I did as per following instructions:
    -Create a keystore to hold the private and public keys for the server. e.g.
    keytool -genkey -keystore mykeystore -alias "myalias" -keypass "mysecret"
    -Export the X509 certificate from this store
    keytool -export -alias "myalias" -keystore mykeystore -file mycertfile.cer
    -Import this into a trustStore for the client
    keytool -import -alias "myalias" -keystore mytruststore -file mycertfile.cer
    -Run the server using the keystore
    java -Djavax.net.ssl.keyStore=mykeystore -Djavax.net.ssl.keyStorePassword="mysecret" EchoServer
    -Run the client using the truststore
    java -Djavax.net.ssl.trustStore=mytruststore -Djavax.net.ssl.trustStorePassword="mysecret" EchoClient localhost
    EchoServer.Java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.Socket;
    import javax.net.ssl.SSLServerSocket;
    import javax.net.ssl.SSLServerSocketFactory;
    public class EchoServer {
    public static int MYECHOPORT = 8189;
    public static void main(String argv[]) {
    try {
    SSLServerSocketFactory factory =
    (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
    SSLServerSocket sslSocket =
    (SSLServerSocket) factory.createServerSocket(MYECHOPORT);
    while (true) {
    Socket incoming = sslSocket.accept();
    new SocketHandler(incoming).start();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(30);
    class SocketHandler extends Thread {
    Socket incoming;
    SocketHandler(Socket incoming) {
    this.incoming = incoming;
    public void run() {
    try {
    BufferedReader reader =
    new BufferedReader(new InputStreamReader(incoming.getInputStream()));
    PrintStream out =
    new PrintStream(incoming.getOutputStream());
    boolean done = false;
    while (!done) {
    String str = reader.readLine();
    if (str == null)
    done = true;
    else {
    System.out.println("Read from client: " + str);
    out.println("Echo: " + str);
    if (str.trim().equals("BYE"))
    done = true;
    incoming.close();
    } catch (IOException e) {
    e.printStackTrace();
    EchoClient.Java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import javax.net.ssl.SSLSocket;
    import javax.net.ssl.SSLSocketFactory;
    public class EchoClient {
    public EchoClient(){}
    public static final int MYECHOPORT = 8189;
    public static void main(String[] args) {
    /*if (args.length != 1) {
    System.err.println("Usage: Client address");
    System.exit(1);
    String sAddress="localhost";
    InetAddress address = null;
    try {
    //address = InetAddress.getByName(args[0]);
    address = InetAddress.getByName(sAddress);
    } catch (UnknownHostException e) {
    e.printStackTrace();
    System.exit(2);
    Socket sock = null;
    try {
    sock = new Socket(address, MYECHOPORT);
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(3);
    SSLSocketFactory factory =
    (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket sslSocket = null;
    try {
    sslSocket =
    (SSLSocket) factory.createSocket(sock, args[0], MYECHOPORT, true);
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(3);
    BufferedReader reader = null;
    PrintStream out = null;
    try {
    reader = new BufferedReader(new InputStreamReader(sslSocket.getInputStream()));
    out = new PrintStream(sslSocket.getOutputStream());
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(6);
    String line = null;
    try {
    // Just send a goodbye message, for testing
    out.println("BYE");
    line = reader.readLine();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(6);
    System.out.println(line);
    System.exit(0);
    } // Client
    Can anybody will please help me to solve my problem i am using JDK1.4.2_07
    Thanks in advance.

    Hi,
    I want to create a SSLSocket based client/server application for this i have used EchoServer.Java and EchoClient.Java files. Both files are successfully compiled and when i ran EchoServer it throws an exception "Server certificate not found".
    I want to make a complete auto-controlled client/server application which will automatically gets certificate and all configuration itself from program because i will use both client and server application in as a servlet part.
    I did as per following instructions:
    -Create a keystore to hold the private and public keys for the server. e.g.
    keytool -genkey -keystore mykeystore -alias "myalias" -keypass "mysecret"
    -Export the X509 certificate from this store
    keytool -export -alias "myalias" -keystore mykeystore -file mycertfile.cer
    -Import this into a trustStore for the client
    keytool -import -alias "myalias" -keystore mytruststore -file mycertfile.cer
    -Run the server using the keystore
    java -Djavax.net.ssl.keyStore=mykeystore -Djavax.net.ssl.keyStorePassword="mysecret" EchoServer
    -Run the client using the truststore
    java -Djavax.net.ssl.trustStore=mytruststore -Djavax.net.ssl.trustStorePassword="mysecret" EchoClient localhost
    EchoServer.Java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.Socket;
    import javax.net.ssl.SSLServerSocket;
    import javax.net.ssl.SSLServerSocketFactory;
    public class EchoServer {
    public static int MYECHOPORT = 8189;
    public static void main(String argv[]) {
    try {
    SSLServerSocketFactory factory =
    (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
    SSLServerSocket sslSocket =
    (SSLServerSocket) factory.createServerSocket(MYECHOPORT);
    while (true) {
    Socket incoming = sslSocket.accept();
    new SocketHandler(incoming).start();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(30);
    class SocketHandler extends Thread {
    Socket incoming;
    SocketHandler(Socket incoming) {
    this.incoming = incoming;
    public void run() {
    try {
    BufferedReader reader =
    new BufferedReader(new InputStreamReader(incoming.getInputStream()));
    PrintStream out =
    new PrintStream(incoming.getOutputStream());
    boolean done = false;
    while (!done) {
    String str = reader.readLine();
    if (str == null)
    done = true;
    else {
    System.out.println("Read from client: " + str);
    out.println("Echo: " + str);
    if (str.trim().equals("BYE"))
    done = true;
    incoming.close();
    } catch (IOException e) {
    e.printStackTrace();
    EchoClient.Java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import javax.net.ssl.SSLSocket;
    import javax.net.ssl.SSLSocketFactory;
    public class EchoClient {
    public EchoClient(){}
    public static final int MYECHOPORT = 8189;
    public static void main(String[] args) {
    /*if (args.length != 1) {
    System.err.println("Usage: Client address");
    System.exit(1);
    String sAddress="localhost";
    InetAddress address = null;
    try {
    //address = InetAddress.getByName(args[0]);
    address = InetAddress.getByName(sAddress);
    } catch (UnknownHostException e) {
    e.printStackTrace();
    System.exit(2);
    Socket sock = null;
    try {
    sock = new Socket(address, MYECHOPORT);
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(3);
    SSLSocketFactory factory =
    (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket sslSocket = null;
    try {
    sslSocket =
    (SSLSocket) factory.createSocket(sock, args[0], MYECHOPORT, true);
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(3);
    BufferedReader reader = null;
    PrintStream out = null;
    try {
    reader = new BufferedReader(new InputStreamReader(sslSocket.getInputStream()));
    out = new PrintStream(sslSocket.getOutputStream());
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(6);
    String line = null;
    try {
    // Just send a goodbye message, for testing
    out.println("BYE");
    line = reader.readLine();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(6);
    System.out.println(line);
    System.exit(0);
    } // Client
    Can anybody will please help me to solve my problem i am using JDK1.4.2_07
    Thanks in advance.

  • Client/server application (Help me)

    I have a client server application.In the client part i send data to the server and the server receive data. After receiveing data server also send some data but the client can't capture data. Anyone please tell me what is the problem?
    I am giving the sample code here......
    I am thinking actually the problem is in the client side.......
    Server
    out = new DataOutputStream(client.getOutputStream());
    input = this.client.getInputStream();
    byte[] data=new byte[input.available()];
    input.read(data);
    byte[] sdata=new byte[3];
    sdata[0]=1;
    sdata[1]=2;
    sdata[2]=3;
    out.write(sdata);
    Client
    How can i implement my client to send and receive at a time??

    Thanks all of u.
    I have solved the problem.
    Now i have another problem.In the Client side I have used DataOutput
    Stream(for sending) and InputStream(for receiving).
    With the InputStream i am capturing data by this way.....
    int dataSize=is.available();
    int kkk=0;
    boolean hasSize=true;
    while (kkk<=0) {
    dataSize = is.available();
             if (dataSize != 0 && hasSize) {
                          byte[] dat = new byte[dataSize];
                          is.read(dat);
                           String s = new String(dat);
                           System.out.println("Capture:" + s);
                           System.out.println("data ssss: "+dataSize);
                           hasSize=false;
                           kkk=9;
                       }//End of if
      }//End of while
                     Here is the problem. If I am sending from the server data size less 4000 byte then the client can easily capture the data. But when i am sending the data which is very very large such as 70,000 bytes then it creates a problem.
    My target is simple. I want to capture the whole data that is send by the server . then want to keep the data in a byte array which size will depend upon the receiving data.
    How can i do that??

  • Problem using the File Dialog Box in a Client/Server application

    I am developping a client-server application using Labview 5.1 . The application on the server acquires data from some instruments and saves it on file, while the application on the clients displayes such acquired data. For doing this I call some routines on the server via the "Open Application vi" (remote connection). All goes well except when I open on the server the "File Dialog Box vi" : in this case the application on the clients is blocked (is blocked the execution of the called vi on the server). Only when
    the File Dialog Box on the server is closed, the execution of the called vi on the server starts again.
    I need to use the File Dialog Box on the server, but I don' t want to stop at the same time
    the clients !!
    I need help for resolving such problem.
    Many thanks in advance !!!

    Hi!
    waldemar.hersacher wrote:
    "It seems that the VIs called by the clients are running in the user interface thread.
    A call to the file dialog box will call a modal system dialog. So LV can't go on executing VIs in the user interface thread."
    Are you sure? I think, that File Dialog, called by LabVIEW File Dialog from Advanced File Functions Palette doesn't blocking any cycles in subVI, which running in UI Thread. Look in my old example (that was prepared for other topic, but may be good for this topic too).
    2 linus:
    I think, you must a little bit reorganize you application for to do this. You must put your File Dialog into separated cycle. This cycle, of course, will be blocked when File Dialog appear on the screen. But other cy
    cle, which responsible for visualization will run continuosly at the same time...
    Attachments:
    no_block_with_file_open_dialog.zip ‏42 KB

  • Servlet in client/server application?

    hi,
    I am planing to make a client server application( SWING & an OODB), would it be clever to use servlet ( not httpservlet) as midle tier framework?
    If yes , what are the benefits?
    Thanks.

    thanks for responding
    actually my client don't wanna run a separate server application on the hosting machine as it costs too much, so thats why i think there is no other way to achieve the task rather than using servlets.
    please do help me or atleast give me a suggestion. actually i'm developing an internet messenger application. i have developed it using client/server application model in which both (the swing client and the server) uses java sockets to communicate with each other. but now i want to develop the server side of the messenger as servlets. but as far as i know the servlets follow the request/response model. if i follow that model i have to use some sort of client pull after certain amount of time say after five or ten seconds, and this approach does not fulfill my requirements as it would slow the performance if there are hundreds of clients calling the servlet every 5 seconds. thus i want to create persisted connections between the client and the servlet which last for the life time of the user's session. also it is important for the data integrity of the application, so please help me in this matter as i have no other source of guidence in this meany world. i hope you will certainely help me in this matter. please mention that if there are any drawbacks of my approach i mean the persisted connections.
    thanks you a lot
    Best reagrds
    Imran Sarwar.

  • Should i use secure sockets for my whole client/server application?

    Hi,
    I have a client server application, and I want to ensure that the login process is secure (i.e. use secure sockets). but I dont know how to switch back to a normal socket once that is done.
    So I am left thinking that i should just use SSL for my whole application, which can last pretty long. But I would rather not. Is there any other way of doing this?
    or should I just encrypt the login info using MD5 or something like that, then send it over an unsecure socket?
    thanks!

    Hey,
    Are you sure you haven't confused JGSS for JSSE?
    Imagine you have a client-server system and you sometimes want data sent over the wire to be encrypted... JGSS offers you this flexibility; if you a encrypted transmission, run ift through JGSS before transmitting it; if you don't want an encrypted transmission, bypass JGSS and just send the transmission.
    The benefit is the security (encryption) isn't hard-wired into you communications protocol i.e. TLS. JGSS has nothing to do with connections it is just protocol for securing messages, not sending them.
    You would need to establish the secure context but this could be done at startup and persist for the duration of you applicaiton invocation. You perhaps might need to implement a mechanism to identify encrypted messages on the receiving peer (so it knows to attempt decryption).
    Admittedly, kerberos seems like one of those 'inside-joke' things. I've come to realise if you don't have some sort of kerberos realm/server against which to authenticate - you need to swap it out as the underlying mechanism. How this is done I'm not sure yet, but I intend to find out today....further down the rabbit hole I go!
    If I discover anything helpful, I will let you know.
    Warm regards,
    D

  • Client Server Application with images or icons

    I made a Client Server application with JFrames, but I put a jLabel with an icon, and I can't run the Client.
    It says java.lang.NullPointerException
    Do you know why I can't see the icon in the JLabel? It isn't an applet, it's an application with JFrames.

    You have to explain the problem better if you want some help. Also show the code which is giving you the nullpointerexception(Do not forget codetags!).

  • Are there any Client/Server Application (using sockets) design patterns?

    Hi,
    The title of the post nearly says it all. I am searching for different design patterns related with the development of a client/server application. I understand that there must be any different ways on how a client/server application can be developed.
    Regards,
    Sim085
    Disclaimer:
    When I enter in the Socket forum on this site I recieve this message "Thank you for any participation in this forum. Due to a lack of relevant activity, we have decided to archive this forum on June 16, 2006. For future posts on this topic, we suggest you use the Networking forum" and I am not allowed to create a new post! However I can see posts done yesterday! All i did is add the forum in 'my forums'. Does this happen to you people as well?

    Hi Sim085...How are you?
    So look this:
    http://forum.java.sun.com/thread.jspa?threadID=5148926&tstart=75
    I don�t know if is what you want...but I hope in this^^
    Ok man...If you have one example for help you is better.
    [ ]

  • Complier error concerning Client Server Application. Error in the server

    Hi I am trying to implement a client server application that will carry out basic calculations. However I am recienving this compiler error within the server class.
    unreported exception java.io.IOException; must be caught or delcared to be thrown.
    The code is pasted below.
    Your help would be much appreciated.
    Kind Regards
    Ridha
    import java.io.*;
    import java.net.*;
    import java.util.Hashtable;
    public class Server
        public static void main(String []args)
            ServerSocket calcServer = null;
            try
                // Create a socket on server
                //ServerSocket ss = new ServerSocket(7);
                calcServer = new ServerSocket(7);
            catch (IOException e)
                System.out.println("Could not listen on port: 7.");
                System.exit(1);
            System.out.println("The Server is Running");
            // When clients connets, make the link and carry on
            Socket clientSocket = null;
            try
             clientSocket = calcServer.accept();
            catch (IOException e)
             System.err.println("Accept Failed");
             System.exit(1);
                // hashtable to manage list of online and offline users
                //Hashtable tOnlineUsers = new Hashtable(10);
                //Hashtable tOfflineUsers = new Hashtable(10);
                // Now start accepting connections from clients in a while loop
                // The server should run in an infinite loop
                 // to get data to and from server
    InputStream in = clientSocket.getInputStream(); < my error is here
                    BufferedReader br = new BufferedReader(new InputStreamReader(in));
                    OutputStream out = clientSocket.getOutputStream();
                    PrintWriter pr = new PrintWriter(out, true);
                while(true)
                    Worker w = new Worker(clientSocket);
                    w.start();
                }   // End of while
            }// End of main()
    }   // End of class

    well, using my superb powers of reasoning and deduction, I can say that this is a lemon entry, watson. the line you kindly highlighted can potentially throw an IOException which you are not dealing with. deal with it

  • Client server application using CORBA

    Hi
    I have a basic client server application running using CORBA/idl where the client starts up and the server says hello back to the client. I have figured out the basics but would like some help with these small problems.
    When I start the client, the server says hello. Thats OK. Now I want the client to start a simple java app (called c:\test.java - it works) that I created before. How?
    The next bit is when I close down the app "test" that I start, I want the server to realise that its closing and simply say goodbye on the client. How?
    If anybody can help me, I'd appreciate it.
    Thanks for your time,
    Shaun

    hi,
    to my knowledge, you will have to define a method in idl file and in your client, which server invocates(saying good bye etc) before shutting down..
    ls.

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

Maybe you are looking for