Client Server Chat program

In a console based Client Server application I used BufferedReader
& BufferedWriter objects to read & write from the socket's i/p & o/p
streams.. But the same doesn't work in a GUI based env...(using Frames)
However readUTF() & writeUTF() with DataInputStream & DataOutputStream
works.. Why BufeeredReader/Writer doesnot work ?

You must be doing something different. Thankfully, neither the streams nor the sockets have any idea that there is a frame in existence.

Similar Messages

  • Multithreading issue with Client/Server chat program

    In a nutshell, I just recently starting attempting to use Sockets and decided I wanted to give a go at a chat program. I have some experience with threads but I know little about how to find and fix multithreading issues. I think this is my problem right now since I am deadlocking while connecting and disconnecting client-side ... and updates about connection status of a client are not always displaying correctly server-side.
    [ Code Snippet|http://snipplr.com/view/15206/clientserver-chat-program/]
    Thanks for the help

    NOTE: all catch clauses have been omitted for clarity. They all just perform System.err.println() with the msg embedded
    Very valid point. I cut out the GUIs and just tried having the Server/Client communicate. I am still having concurrency issues. This is my first attempt at synchronized methods and locking objects so go easy on me if I did something(s) noob =D
    public class MySocket
        public static final String QUIT = "~~QUIT~~";
        private ObjectOutputStream out;
        private ObjectInputStream in;
        private Socket conn;
        public MySocket(String ip)
            obsList = new ArrayList<IClientObs>();
            try
                conn = new Socket(ip, 5000);
                if (conn.isConnected())
                    out = new ObjectOutputStream(conn.getOutputStream());
                    in = new ObjectInputStream(conn.getInputStream());
        public synchronized String nextMsg()
            String msg = "";
            try
                synchronized(in)
                    msg = (String)in.readObject();
                    notify(msg);
            return(msg);
        public synchronized boolean sendMsg(String msg)
            boolean sentMsg = false;
            try
                synchronized(out)
                    if (out != null)
                        out.writeObject(msg);
                        out.flush();
                        sentMsg = true;
            return(sentMsg);
        public synchronized void closeConn()
            try
                synchronized(this)
                    sendMsg(QUIT);
                    conn.close();
                    out.close();
                    in.close();
        public synchronized Socket getConn()
            return(conn);
        public synchronized ObjectOutputStream getOutStream()
            return(out);
        public synchronized ObjectInputStream getInStream()
            return(in);
       //Observer Pattern implemented below   
    public class Server extends Thread
        public static final int MAX_CLIENTS = 2;
        public static final String QUIT = "~~QUIT~~";
        private ServerSocket server;
        private ArrayList<ConnClient> conns;
        private int connCount;
         * Constructor for objects of class Server
        public Server()
            conns = new ArrayList<ConnClient>();
            obsList = new ArrayList<IServerObs>();
            connCount = 0;
        public void startNow()
            this.start();
        public void run()
            runServer();
        public synchronized void runServer()
            try
                setup();
                while (true)
                    waitForConn();
                    processComms();
        private synchronized void setup() throws IOException
            server = new ServerSocket(5000);
            notify("Server initialized.\n");
        private synchronized void waitForConn() throws IOException
            if (connCount < MAX_CLIENTS)
                notify("Waiting for connection...\n");
                Socket conn = server.accept();
                if (conn.isConnected())
                    conns.add(new ConnClient(conn));
                    notify("Client connected @ '" + conns.get(connCount).getIP() + "'.\n");
                    connCount++;
            else
                notify("Connection request rejected; max connections have been reached.\n");
        private synchronized void processComms() throws IOException, ClassNotFoundException
            //Receive any msgs sent by clients and forward msg to all clients
            for(ConnClient rcvClient : conns)
                String msg = rcvClient.nextMsg();
                //if client quit, then close connection and remove it from list
                if (msg.equals(QUIT))
                    notify("Client disconnected @ '" + rcvClient.getIP() + "'.\n");
                    rcvClient.closeConn();
                    conns.remove(rcvClient);
                    connCount--;
                else
                    for(ConnClient sndClient : conns)
                        sndClient.sendMsg(msg);
        public synchronized void shutdown()
            try
                server.close();
                for(ConnClient client :conns)
                    client.closeConn();
       //Observer Pattern implemented below
    }I also found another issue that I haven't thought up a way to deal with yet. When the user starts the program the follow line is executed "conn = server.accept();" which halts execution
    on that thread until a connection is established. What if the user wants to stop the server before a connection is made? The thread keeps running, waiting for a connection. How do I kill this thread?
    On this last issue (I figured by adding the follow code to my action listener inside of my server gui I could stop the thread safely but it's no good so far)
    public void actionPerformed(ActionEvent e)
            Object src = e.getSource();
            if (src == strBtn)
                if (server == null)
                    strBtn.setEnabled(false);
                    stpBtn.setEnabled(true);
                    server = new Server();
                    server.addObserver(this);
                    server.start();
                else
                    console.append("Console: Server is alread initiated.\n");
            else if (src == stpBtn)
                synchronized(server)
                strBtn.setEnabled(true);
                stpBtn.setEnabled(false);
                server.shutdown();
                server = null;
                console.append("Console: Server has been stopped.\n");
        }Edited by: mcox05 on May 21, 2009 10:05 AM
    Edited by: mcox05 on May 21, 2009 10:17 AM
    Edited by: mcox05 on May 21, 2009 10:58 AM
    Edited by: mcox05 on May 21, 2009 11:01 AM
    Edited by: mcox05 on May 21, 2009 11:03 AM
    Edited by: mcox05 on May 21, 2009 11:03 AM

  • Help with client server chat 1

    Hi,
    I have to create small multithreaded client/server. chat program. Server and client have to exchange messages using input boxes until user types QUIT. I did most of it(I think) but it seems that server does not receives client messages and input boxes are displayed only once. I can�t figure out what is the problem. Here is what I did .I know it�s not easy to understand somebody else�s code, but if anybody have some spare time?
    this is just a server part, client is in second posting
    SERVER.JAVA
    import java.io.*;
    import java.net.*;
    import java.lang.*;
    import javax.swing.*;
    public class Server
    final int SBAP_PORT = 5555;
    //constructor
    public Server(){
    //set up server socket
    ServerSocket ss = null;
    try {
    ss = new ServerSocket(SBAP_PORT);
    } //end try
    catch (Exception e) {
    System.out.println("Could not create socket: Exception " + e);
    System.exit(0);
    } //end catch
    //chat with the client until user break the connection or enters QUIT
    try {
    while(true) {
    System.out.println("Server: Waiting for client to connect ...");
    Socket currentSocket = ss.accept();
    //create a new thread for each connection
    new ServerThread(currentSocket);
    } //end while
    } //end try
    catch (Exception e) {
    System.out.println("Fatal server error: " + e);
    }//end catch
    }//end constructor
    //inner class ServerThread to handle individual client connections
    private class ServerThread extends Thread {
    private Socket sock;
    private InputStream in=null;
    private OutputStream out=null;
    private BufferedReader reader = null;
    private PrintWriter writer = null;
    //constructor
    public ServerThread(Socket sock) {
    try{
    this.sock=sock;
    System.out.println("Server: Client connection established");
    start();
    }//end try
    catch (Exception e){}
    }//end constructor
    public void run() {
    try{
    in = this.sock.getInputStream();
    out =this.sock.getOutputStream();
    reader = new BufferedReader(new InputStreamReader(in));
    writer = new PrintWriter(out);
    while(true) {
    String server_response = JOptionPane.showInputDialog(null,"Server Response");
    System.out.println("Sending: " + server_response);
    writer.println(server_response);
    writer.flush();
    String line = reader.readLine(); //receives client request
    if (line == null || line.equals("QUIT"))
    System.out.println("No data received");
    else
    System.out.println("Received: " + line);
    }//end while
    }//end try
    catch (Exception e) {
    System.out.println("Connection to current client lost.");
    finally {
    try {
    sock.close();
    }//end try
    catch (Exception e) {}
    }//end finally
    }//end run
    }//end inner class ServerThread
    //main starts
    public static void main(String[] args) {
    new Server();
    }//end main()
    }//end class Server

    http://forum.java.sun.com/thread.jspa?threadID=574466&messageID=2861516#2861516

  • Desperately need some help with client-server java programming

    Hi all,
    I'm new to client server java programming. I would like to work on servlets and apache tomcat. I installed the apache tomcat v 5.5 into my machine and i have sun java 6 also. I created a java applet class to be as a client and embed it into an html index file, like this:
    <applet code="EchoApplet.class" width="300" height="300"></applet>However, when I try to run the html file on the localhost, it print this error: classNotFoundException, couldn't load "EchoApplet.class" class. On the other hand, when I open the index file on applet viewer or by right clicking, open with firefox version 3, it works.
    I thought that the problem is with firefox, but after running the applet through the directory not the server, i found that the problem is not any more with firefox.
    Can anyone help me to solve this problem. I'm working on it for 5 days now and nothing on the net helped me. I tried a lot of solutions.
    Any help?

    arun,
    If the browser is going to execute $myApplet, first it must get the $myApplet.class from the server, right?
    So it follows that:
    1. $myApplet.class must be acessible to server, and
    2. the server must know exactly where to find $myApplet.class
    So, the simplest solution is to is put the $myApplet.class in the same directory as the HTML file which uses it... then your applet tag is simple:
      <applet height="200" width="400" code="$myApplet.class" ></applet>* The height & width attributes are required
    * Note the +.class+ is required in the code attribute (a common mistake).
    * This works uniformly (AFAIK) accross all java-enabled browsers.
    * There are incompatibilities with the codebase attribute. Poo!
    Cheers. Keith.

  • Client-Server side programing problem

    I designed a client-server program as seen below basis on serversocket and thread
    I use serversocket for making a host connection than people connect this socket via applet that i designed then they transffer data with socket.getInputStream() and socket.getOutputStream but it always happening between client and server how can i make theese streams transfer between clients is something like that possible if it is how?
    I couldnt send my hole java code because its too long and i wish i could explain my problem
        public void run()
            try
                servsocket = new ServerSocket(port);
                jTextArea1.append("Kullanici Girisi Bekleniyor.\n");
            catch(IOException e)
                jTextArea1.append("Sunucu Uzerinde Socket Acilamadi.\n");
                while(calisiyor)  //calisiyor variable is a boolean variable for checking if server is running
                    try
                    Socket sock = servsocket.accept();
                    background = new techsupportbackground(this,sock);
                    background.start();
                    catch(Exception e)
                        printstring("Hata:"+e);
                        break;
    this is the techsupportbackground classes run method it extends from thread
        public void run()
            if(!servicesetup()) return;
            support.printstring("Baglanti saglandi,kullanici basariyla giris yapti.");
            setPriority(MIN_PRIORITY);
            String sonmesaj = "";
            while(calisiyor)
                String mesaj = readinputline();
                if(mesaj == null) break;
                if (!sonmesaj.equals(mesaj))
                    support.printstring(username+"->"+mesaj);
                    sonmesaj = mesaj;
            cikis();
    and this is the client side program's run method
        public void run()
            try
                if(!doconnection())
                    client.printstring("Baglanti Saglanamadi:");
                    return;
            catch(Exception e)
                client.printstring("Baglanti Saglanamadi");
            while (calisiyor)
                String mesaj = readline();  //readline is the method which reads sockets input stream
                client.printstring(mesaj);
                    if (mesaj == null) break;
                    try {
                    Thread.sleep (client.timeupdate);
                    catch (InterruptedException e)
            if (server != null) closeserver();
            client.setdisconnected();
            client.printstring("Baglanti Koptu");

    I made two java file , one for server one for client
    server is working good openning the socket but the client is crashing when i attempt to connect to server
    here is my code if anyone could tell me where i made a mistake i would be very appreciate
    this is the client program
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class client extends javax.swing.JFrame {
        private boolean baglandi;
        private MulticastSocket socket;
        private int port;
        private String ip;
        String username;
        private InetAddress group;
        private String msg;
        private DatagramPacket datawriter;
        private byte[] reader;
        private boolean calisiyor;
        private JScrollPane scrollpane;
        public client() {
            initComponents();
            this.setSize(490,450);
            jTextArea1.setEditable(false);
            jTextField2.setEditable(false);
            jButton2.setEnabled(false);
            jLabel3.setForeground(Color.RED);
            JPanel panel = new JPanel();
            panel.setLayout(new BorderLayout());
            panel.setBounds(0, 0, 480, 260);
            getContentPane().add(panel);
            scrollpane = new JScrollPane();
            scrollpane.getViewport().add(jTextArea1);
            panel.add(scrollpane,BorderLayout.CENTER);
            baglandi=false;
            ip="228.5.6.7";
            port=2222;
            try
            group = InetAddress.getByName(ip);
            msg ="";
            datawriter = new DatagramPacket(msg.getBytes(),msg.length(),group,port);
            calisiyor = false;
            catch(Exception e)
        private void initComponents() {
            jTextArea1 = new javax.swing.JTextArea();
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jTextField1 = new javax.swing.JTextField();
            jTextField2 = new javax.swing.JTextField();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jLabel3 = new javax.swing.JLabel();
            getContentPane().setLayout(null);
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            getContentPane().add(jTextArea1);
            jTextArea1.setBounds(0, 0, 480, 260);
            jLabel1.setText("Kullanici Adi");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(0, 270, 90, 15);
            jLabel2.setText("Mesaj");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(0, 300, 60, 15);
            getContentPane().add(jTextField1);
            jTextField1.setBounds(100, 270, 290, 21);
            getContentPane().add(jTextField2);
            jTextField2.setBounds(100, 300, 290, 21);
            jButton1.setText("Gonder");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            getContentPane().add(jButton1);
            jButton1.setBounds(400, 270, 80, 25);
            jButton2.setText("Gonder");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
            getContentPane().add(jButton2);
            jButton2.setBounds(400, 300, 80, 25);
            jButton3.setText("Durdur");
            jButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton3ActionPerformed(evt);
            getContentPane().add(jButton3);
            jButton3.setBounds(400, 340, 80, 25);
            jLabel3.setText("Baglanti Saglanamadi");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(0, 360, 130, 15);
            pack();
        private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
            durdur();
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
            printoutput();
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
            baslat();
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new client().show();
        public void baslat()
            username = jTextField1.getText();
            try
                socket = new MulticastSocket(port);
                socket.joinGroup(group);
            catch(IOException e)
                jTextArea1.append("Guvenlik Engellemesi Sebebiyle Sunucuya Ulasilamadi.\n");
                return;
                    jTextArea1.append("Sunucuya Baglanildi");
                    baglandi = true;
                    calisiyor = true;
                    jLabel3.setText("Baglanti Saglandi");
                    jTextArea1.append("Sunucuya Basariyla Baglanildi\n");
                    jLabel3.setForeground(Color.GREEN);
                    jButton1.setEnabled(false);
                    jTextField1.setEditable(false);
                    jButton2.setEnabled(true);
                    jTextField2.setEditable(true);
                while (calisiyor)
                        String mesaj = readline();
                        printstring(mesaj);
                        if (mesaj == null) break;
        public void durdur()
            jTextField2.setEditable(false);
            jTextField1.setEditable(true);
            jButton2.setEnabled(false);
            jButton1.setEnabled(true);
            jLabel3.setText("Baglanti Saglanamadi");
            jLabel3.setForeground(Color.RED);
            try
                socket.leaveGroup(group);
            catch(Exception e)
        public void printoutput()
            try
            String mesaj = jTextField2.getText();
            jTextField2.setText("");
            writeline(username+":->"+mesaj);
            catch(Exception e)
                printstring("Veri Ulastirilamadi.");
        public void printstring(String s)
            jTextArea1.append(s+"\n");
        public void setdisconnected()
            jTextField2.setEditable(false);
            jTextField1.setEditable(true);
            jButton2.setEnabled(false);
            jButton1.setEnabled(true);
            jLabel3.setText("Baglanti Saglanamadi");
            jLabel3.setForeground(Color.RED);
            public String readline()
                byte[] buf = new byte[1000];
                DatagramPacket datapack = new DatagramPacket(buf,buf.length);
                try
                    socket.receive(datapack);
                    String mesaj = buf.toString();
                    return mesaj;
                catch(Exception e)
                    printstring("Sunucuya Ulasilamadi");
                    return null;
        public void writeline(String s) throws IOException
                try
                    msg = s;
                    socket.send(datawriter);
                    printstring(msg);
                catch(Exception e)
                    printstring("Mesaj ulastirilamadi.");
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JTextArea jTextArea1;
        private javax.swing.JTextField jTextField1;
        private javax.swing.JTextField jTextField2;
        // End of variables declaration
    this is the server program
    import java.net.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class techsupport extends javax.swing.JFrame implements ActionListener,Runnable {
        private MulticastSocket servsocket;
        private int port;
        private boolean calisiyor;
        private JScrollPane scrollpane;
        private techsupportbackground  background;
        private InetAddress group;
        public techsupport(String title) {
            super(title);
            initComponents();
            this.setSize(400,400);
            port=2222;
            jTextField1.addActionListener(this);
            jButton1.addActionListener(this);
            calisiyor=true;
            jTextArea1.setEditable(false);
            JPanel panel = new JPanel();
            panel.setLayout(new BorderLayout());
            panel.setBounds(0,10,400, 230);
            getContentPane().add(panel);
            scrollpane = new JScrollPane();
            scrollpane.getViewport().add(jTextArea1);
            panel.add(scrollpane,BorderLayout.CENTER);
                try
                group = InetAddress.getByName("228.5.6.7");
                catch(Exception e)
        private void initComponents() {
            jTextArea1 = new javax.swing.JTextArea();
            jButton1 = new javax.swing.JButton();
            jLabel1 = new javax.swing.JLabel();
            jButton2 = new javax.swing.JButton();
            jTextField1 = new javax.swing.JTextField();
            getContentPane().setLayout(null);
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            getContentPane().add(jTextArea1);
            jTextArea1.setBounds(0, 10, 400, 230);
            jButton1.setText("Start");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            getContentPane().add(jButton1);
            jButton1.setBounds(160, 260, 80, 25);
            jLabel1.setText("Port");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(0, 240, 120, 15);
            jButton2.setText("Stop");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
            getContentPane().add(jButton2);
            jButton2.setBounds(250, 260, 90, 25);
            getContentPane().add(jTextField1);
            jTextField1.setBounds(0, 260, 130, 21);
            pack();
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
            try
            servsocket.close();
            jButton1.setEnabled(true);
            printstring("Port Kapatildi.");
            jTextArea1.setText("");
            catch(Exception e)
                printstring("Hata:"+e);
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
        public static void main(String args[]) {
            new techsupport("Teknik Destek Sunucu").show();
        public void actionPerformed(ActionEvent e) {
            boolean status = false;
            String komut = e.getActionCommand();
                if (komut.equals("Start"))
                    try
                        port = Integer.parseInt(jTextField1.getText());
                        jButton1.setEnabled(false);
                    catch(NumberFormatException err)
                        jTextArea1.append("Hatali Port Numarasi"+"\n");
                        jButton1.setEnabled(true);                   
                    Thread uygulama = new Thread(this);
                    uygulama.start();
                else if (komut.equals("Stop"))
                    calisiyor=false;
                    dispose();
        public void run()
            try
                servsocket = new MulticastSocket(port);
                servsocket.joinGroup(group);
                jTextArea1.append("Kullanici Girisi Bekleniyor.\n");
            catch(IOException e)
                jTextArea1.append("Sunucu Uzerinde Socket Acilamadi.\n"+e.toString());
        public void printstring(String s)
            jTextArea1.append(s+"\n");
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JTextArea jTextArea1;
        private javax.swing.JTextField jTextField1;
        // End of variables declaration
    }

  • Help needed with a chat program

    Hi everyone! i'm busy with a client/server chat program. I'm really stuck because i can't seem to get the messages from one client to show on the other client's screen.
    If one client sends a message to another client, the server receives the message, but the second client does not receive the message.
    Here is the server code that sends messages to the clients:
    BufferedReader incomeReader = null;
    PrintWriter outWriter = null;
    try {
         incomeReader = new BufferedReader(new InputStreamReader (incomingSocket.getInputStream()));
    outWriter = new PrintWriter(incomingSocket.getOutputStream(),true);
    }catch (Exception e) {
              System.out.println("error handling a client: " + e);
    System.exit(-1);
    line = incomeReader.readLine();
    textArea.append(line + "\n");               
    outWriter.println(line);
    The server is suppose to put the message it receives on the text area on the server screen, and then send the message to all clients connected to it.
    I hope somebody will be able to help me...

    The code posted just sends any data it receives back to the person who sent it. To get it to work there, you probably should flush after the println. I believe your mother taught you always to flush. It seems you have forgotten.

  • Client/server program validation - is it possible?

    I've been mulling over this problem for a few days, and am starting to wonder if it's theoretically possible to find a solution. I'm not looking for specific code, this probably won't even be implemented in Java, I'm just wondering if there is a theoretical program model that would work in this situation.
    The short version:
    Validate the data generated by a client program, without knowing the original data.
    The long version:
    This is a "profiling" system for a MMOG (Massively Multiplayer Online Game). The MMOG is an internet based client/server graphical program where each client connects to the server and they interact with each other and the virtual world. They pay a monthly fee for access to the game. My program is not affiliated with the MMOG or its makers. I have no connections inside the company and cannot expect any cooperation from them.
    The "profiling" system is also a client/server model. The client program runs in the background while the MMOG client is active. It accesses the memory of the MMOG client to retrieve information about the player's character. Then, possibly on request or maybe immediately, it sends the character data to our server.
    What I want to validate is that the character data being sent is unmodified and actually comes from the MMOG program.
    I can reasonably expect that with mild encryption and some sort of checksum or digest, the vast majority of problems can be avoided. However, I am not sure it's possible to completely secure the system.
    I assume that the user has access to and knowledge of the profiler client and the MMOG client, their assembly code, and the ability to modify them or create new programs, leveraging that knowledge. I also assume that the user does not have access to or knowledge of either of the server applications - the MMOG server or mine.
    In a worst-case scenario, there are several ways they could circumvent any security I have yet been able to think of. For instance, they could set up a fake MMOG client that had the data they wanted in memory, and let the profiler access that instead of the real thing. Or, they could rewrite the profiler to use the data they wanted and still encrypt it using whatever format I had specified.
    I have been considering using some kind of buffer overflow vulnerability or remote execution technique that would allow me to run specific parts of the client program on command, or get information by request, something that could not be anticipated prior to execution and thus could not be faked. But this seems not only insecure for the client but also not quite solid enough, depending on how it was implemented.
    Perhaps a series of apparently random validation codes, where the client does not know which one actually is doing the validation, so it must honor them all. Again, this is very conceptual and I'm sure that I'm not explaining them very well. I'm open to ideas.
    If I don't come up with anything better, I would consider relying on human error and the fact that the user will not know, at first, the relevance of some of the data being passed between client and server. In this case, I would include some kind of "security handshake" that looks like garbage to the client but actually is validated on the server end. A modified program or data file would result in an invalid handshake, alerting the server (and me) that this client was a potential problem. The client would have no idea anything had gone wrong, because they would not know what data the server was expecting to receive.
    I hope I have not confused anyone too much. I know I've confused myself....

    Yes, that is the general model for all MMOGs these days - no data that can actually affect the game is safe if loaded from the client's computer. All character and world data is sent from server to client and stored in memory. Any information that is saved to the client's computer is for reference only and not used by the game engine to determine the results of actions/events etc.
    My program accesses the MMOG client's memory while the game is running, and takes the character information from there. It does not have direct access to the MMOG server, and does not attempt to modify the data or the memory. Instead, it just encrypts it and sends it to our server, where the information is loaded into a database.
    The security issue comes into play because our database is used for ranking purposes, and if someone were to hack my program, they could send invalid data to our servers and affect the rankings unfairly.
    I'm just trying to think of a way to prevent that from happening.

  • Is that possible ?  (Chat Program)

    I just found a great source code for a basic Server/Chat Program, but both works on a Frame... I want the Client to run on an Applet (Web Page) and the server to run on a PC in a Frame.
    Is that possible... ? If yes, how do I do that? I can send the source code if you want.

    Hi,
    I am developing a socket server and client application for some other purpose than chatting. In my application, the <b>Log Server</b> is a Daemon Thread always be listening to the client requests. On listening to a request it spawns a <B>RequestProcessor</B> thread to process the requests.
    The client is a session manager servlet. When the new HTTP request is taken by it, it has to write the status of the HTTP request into to the remote log files on the Log server. So at the beginning HTTP request, it has to write into the remote log file. And then process the request which may take a few seconds. At the HTTP request process, this has to write again into the remote log file on Log Server.
    In my code now: The session manager will open a client socket to the server. At the beginning of the HTTP request, it will getOutputStream() of that socket and flushes the data to the OutputStream. Please note that it doent close that client socket. Then it does some processing. Then at the beginning of the HTTP request, it will re-use the same client socket and get the outputStream of that socket and flushes the data to the OutputStream.
    If I do this, what I observed is unless i close the client socket, the data is not actually being written to the outputstream. The server side <B>RequestProcessor</B> thread is able to read the data from the sockets inputstream, only when the client socket is closed.
    Please suggest me how to resolve this. So that when ever the data is flushed to the outputsteram, the server side <B>RequestProcessor</B> thread must be able to read that immediately.
    Please let me know asap.
    Thanks in advance
    Murali

  • Client Server Socket With GUI

    Hi,
    As the name of the forum suggests I am very new to this whole thing.
    I am trying to write a client/server socket program that can encrypt and decrypt and has a GUI, can't use JCE or SSL or any built in encryption tools.
    I have the code for everything cept the encryption part.
    Any help, greatly appreciated,

    tnks a million but how do i incorporate that into the following client and server code:
    here's the client code:
    import java.awt.Color;
    import java.awt.BorderLayout;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.net.*;
    class SocketClient extends JFrame
              implements ActionListener {
    JLabel text, clicked;
    JButton button;
    JPanel panel;
    JTextField textField;
    Socket socket = null;
    PrintWriter out = null;
    BufferedReader in = null;
    SocketClient(){ //Begin Constructor
    text = new JLabel("Text to send over socket:");
    textField = new JTextField(20);
    button = new JButton("Click Me");
    button.addActionListener(this);
    panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setBackground(Color.white);
    getContentPane().add(panel);
    panel.add("North", text);
    panel.add("Center", textField);
    panel.add("South", button);
    } //End Constructor
    public void actionPerformed(ActionEvent event){
    Object source = event.getSource();
    if(source == button){
    //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);
    public void listenSocket(){
    //Create socket connection
    try{
    socket = new Socket("HUGHESAN", 4444);
    out = new PrintWriter(socket.getOutputStream(), true);
    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    } catch (UnknownHostException e) {
    System.out.println("Unknown host: HUGHESAN.eng");
    System.exit(1);
    } catch (IOException e) {
    System.out.println("No I/O");
    System.exit(1);
    public static void main(String[] args){
    SocketClient frame = new SocketClient();
         frame.setTitle("Client Program");
    WindowListener l = new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.addWindowListener(l);
    frame.pack();
    frame.setVisible(true);
         frame.listenSocket();
    SERVER Code
    import java.awt.Color;
    import java.awt.BorderLayout;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.net.*;
    class SocketServer extends JFrame
              implements ActionListener {
    JButton button;
    JLabel label = new JLabel("Text received over socket:");
    JPanel panel;
    JTextArea textArea = new JTextArea();
    ServerSocket server = null;
    Socket client = null;
    BufferedReader in = null;
    PrintWriter out = null;
    String line;
    SocketServer(){ //Begin Constructor
    button = new JButton("Click Me");
    button.addActionListener(this);
    panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setBackground(Color.white);
    getContentPane().add(panel);
    panel.add("North", label);
    panel.add("Center", textArea);
    panel.add("South", button);
    } //End Constructor
    public void actionPerformed(ActionEvent event) {
    Object source = event.getSource();
    if(source == button){
    textArea.setText(line);
    public void listenSocket(){
    try{
    server = new ServerSocket(4444);
    } catch (IOException e) {
    System.out.println("Could not listen on port 4444");
    System.exit(-1);
    try{
    client = server.accept();
    } catch (IOException e) {
    System.out.println("Accept failed: 4444");
    System.exit(-1);
    try{
    in = new BufferedReader(new InputStreamReader(client.getInputStream()));
    out = new PrintWriter(client.getOutputStream(), true);
    } catch (IOException e) {
    System.out.println("Accept failed: 4444");
    System.exit(-1);
    while(true){
    try{
    line = in.readLine();
    //Send data back to client
    out.println(line);
    } catch (IOException e) {
    System.out.println("Read failed");
    System.exit(-1);
    protected void finalize(){
    //Clean up
    try{
    in.close();
    out.close();
    server.close();
    } catch (IOException e) {
    System.out.println("Could not close.");
    System.exit(-1);
    public static void main(String[] args){
    SocketServer frame = new SocketServer();
         frame.setTitle("Server Program");
    WindowListener l = new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.addWindowListener(l);
    frame.pack();
    frame.setVisible(true);
         frame.listenSocket();
    Again help on this is very welcomed

  • Fault tolerance client /server

    hi
    i use a very basic client/server socket program
    very similar to sun:
    http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
    many client can connect to the server...
    i would like to add a fault tolerance...
    a client try to connect a few time... that don't work, the client try to the second server...
    does a need to do something similar to
    public class KKMultiServer {
        public static void main(String[] args) throws IOException {
            ServerSocket serverSocket1 = null;
            ServerSocket serverSocket1 = null;
            boolean listening = true;
            try {
                serverSocket = new ServerSocket(4444);
                serverSocket = new ServerSocket(4445);
            } catch (IOException e) {
                System.err.println("Could not listen on port.");
                System.exit(-1);
            while (listening){
             new KKMultiServerThread(serverSocket1.accept()).start();
                new KKMultiServerThread(serverSocket2.accept()).start();
            serverSocket1.close();
            serverSocket2.close();
    }thanks

    i need your help to finis my code
    what i want to do is to create to start 2 tread of server in my class main server....
    and each class server start a thread for each connection...
    each time a client do a request, i count it
    theses method is in server class
    import java.net.*;
    import java.io.*;
    public class ServerMain {
        public static void main(String[] args) throws IOException {
             //will call 2 time server here         
             Server server1 = new Server();
             Server server2 = new Server();
             server1(4444).start();
             server2(4445).start();
    import java.net.*;
    import java.io.*;
    public class Server extends Thread{
        private static int nbRequete=0;
        public synchronized int ajouterRequete(){
            return nbRequete++;
        public synchronized int getRequete(){
            return nbRequete;
        public int port=0;
        public Server(int port) {
            super("Server");
            this.port = port;
        public void run() {
            ServerSocket serverSocket = null;
            Socket s=null;
            boolean listening = true;
           // Server server = new Server();
           // int port;
            try {
                 //will put a port variable
                serverSocket = new ServerSocket(port);
                s=serverSocket.accept();
            } catch (IOException e) {
                System.err.println("Could not listen on port.");
                System.exit(-1);
            System.out.println("server run, wait connecting....");
            while (listening)
                new ServerThread(s).start();
            //serverSocket.close();
    import java.net.*;
    import java.io.*;
    public class ServerThread extends Thread {
        private Socket socket = null;
        public ServerThread(Socket socket) {
            super("ServerThread");
            this.socket = socket;
        public void run() {
            try {
                System.out.println("connexion successfull");
                System.out.println("Attente de l'entree.....");
                PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
                BufferedReader in = new BufferedReader(
                            new InputStreamReader(
                                socket.getInputStream()));
                String inputLine, outputLine;
                while ((inputLine = in.readLine()) != null) {
                    System.out.println("Server: " + inputLine);
                    inputLine = inputLine.toUpperCase();
                    out.println(inputLine);
                    if (inputLine.equals("Bye."))
                        break;
                out.close();
                in.close();
                socket.close();
            } catch (IOException e) {
                e.printStackTrace();
    }the server need to have different port
    i'm a little bit confuse
    i don't know how to finish this project
    :confused:
    i have some error i don't understand
    ServerMain.java:11: cannot find symbol
    symbol  : constructor Server()
    location: class Server
            Server server1 = new Server();
                             ^
    ServerMain.java:12: cannot find symbol
    symbol  : constructor Server()
    location: class Server
            Server server2 = new Server();
                             ^
    ServerMain.java:13: cannot find symbol
    symbol  : method server1(int)
    location: class ServerMain
            server1(4444).start();
            ^
    ServerMain.java:14: cannot find symbol
    symbol  : method server2(int)
    location: class ServerMain
            server2(4445).start();
            ^
    4 errors

  • Client- server -client

    Hi...
    for training i created a simple server (with multithreading) and a simple client. I tried also to send strings from client to server and vice versa. Now...how can i create a connection between two clients using the server? For example, how can a client (connected to the server) send messagges to another client (connected to the same server)?

    Errr, well,
    I'm no pro at this, I just started my own client -> server like program a while ago. So I'll give you my code and a quick overview here. And while your all at it, tell me why the program won't run from the "run.bat" file. It works on my computer, not others. I'll leave the server on for those who want to try it.
    FOLLOW THE DARN INSTRUCTIONS (theres only 6 short ones)
    http://www.freewebs.com/ringdelapong/index.html
    Pay no attention to the name, "Black Path". I intend on making this a game, thus the name...
    Overview:
    --------- Server
    1) Have a server (not include) with a thread that accepts any client
    sockets.
    2) Each time the server accepts a socket, start a thread to read input and send output to.
    --------- Client
    1) Find the server based on some IP address.
    2) Setup a input, output thread
    That easy. Client code is in the jar file of that program. If you look at the clientMessage class, you'll note that a special code was used to talk between server and client. The server and clients only understand this code format.
    Yo welcome.

  • Clent-Server Chat Messenger TESTING

    HI
    We have developed a Client-Server Chat Messenger.
    Can anyone suggest me a good, free of cost Testing Tool for LOAD TESTING the Messenger.

    i would write a programm which creates as many "client"-threads as i want. so u need to start this tool just one time.
    but remember. on a pc with one cpu only it always will be a simulated parallelity. if u wanna real test, u have to find some users who would it do. just betatesters :)

  • Client-Server side GUI programming

    I want to create a client-server side gui programming with java
    i read this web adress
    http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
    for information but there are some parts that i didnt understand and wait for your help
    i m trying to build an online-help(live chat) system so when people press the start chat button a java page will appear but i wonder how this will connect to the person who is on server side
    i mean is it possible to 2 users connect the same port and chat with each other
    I mean when user press the chat button the online help supporter will be informed somebody wants to speak with him and they will start a chat
    how can i do something like that
    any help would be usefull thanks

    Below is an example of a client/server program.
    It shows how the server listens for multiple clients.
    * TriviaServerMulti.java
    * Created on May 12, 2005
    package server;
    * @author johnz
    import java.io.*;
    import java.net.*;
    import java.util.Random;
    * This TriviaServer can handle multiple clientSockets simultaneously
    * This is accomplished by:
    * - listening for incoming clientSocket request in endless loop
    * - spawning a new TriviaServer for each incoming request
    * Client connects to server with:
    * telnet <ip_address> <port>
    *     <ip_address> = IP address of server
    *  <port> = port of server
    * In this case the port is 4413 , but server can listen on any port
    * If server runs on the same PC as client use IP_addess = localhost
    * The server reads file
    * Note: a production server needs to handle start, stop and status commands
    public class TriviaServerMulti implements Runnable {
        // Class variables
        private static final int WAIT_FOR_CLIENT = 0;
        private static final int WAIT_FOR_ANSWER = 1;
        private static final int WAIT_FOR_CONFIRM = 2;
        private static String[] questions;
        private static String[] answers;
        private static int numQuestions;
        // Instance variables
        private int num = 0;
        private int state = WAIT_FOR_CLIENT;
        private Random rand = new Random();
        private Socket clientSocket = null;
        public TriviaServerMulti(Socket clientSocket) {
            //super("TriviaServer");
            this.clientSocket = clientSocket;
        public void run() {
            // Ask trivia questions until client replies "N"
            while (true) {
                // Process questions and answers
                try {
                    InputStreamReader isr = new InputStreamReader(clientSocket.getInputStream());
                    BufferedReader is = new BufferedReader(isr);
    //                PrintWriter os = new PrintWriter(new
    //                   BufferedOutputStream(clientSocket.getOutputStream()), false);
                    PrintWriter os = new PrintWriter(clientSocket.getOutputStream());
                    String outLine;
                    // Output server request
                    outLine = processInput(null);
                    os.println(outLine);
                    os.flush();
                    // Process and output user input
                    while (true) {
                        String inLine = is.readLine();
                        if (inLine.length() > 0)
                            outLine = processInput(inLine);
                        else
                            outLine = processInput("");
                        os.println(outLine);
                        os.flush();
                        if (outLine.equals("Bye."))
                            break;
                    // Clean up
                    os.close();
                    is.close();
                    clientSocket.close();
                    return;
                } catch (Exception e) {
                    System.err.println("Error: " + e);
                    e.printStackTrace();
        private String processInput(String inStr) {
            String outStr = null;
            switch (state) {
                case WAIT_FOR_CLIENT:
                    // Ask a question
                    outStr = questions[num];
                    state = WAIT_FOR_ANSWER;
                    break;
                case WAIT_FOR_ANSWER:
                    // Check the answer
                    if (inStr.equalsIgnoreCase(answers[num]))
                        outStr="\015\012That's correct! Want another (y/n)?";
                    else
                        outStr="\015\012Wrong, the correct answer is "
                            + answers[num] +". Want another (y/n)?";
                    state = WAIT_FOR_CONFIRM;
                    break;
                case WAIT_FOR_CONFIRM:
                    // See if they want another question
                    if (!inStr.equalsIgnoreCase("N")) {
                        num = Math.abs(rand.nextInt()) % questions.length;
                        outStr = questions[num];
                        state = WAIT_FOR_ANSWER;
                    } else {
                        outStr = "Bye.";
                        state = WAIT_FOR_CLIENT;
                    break;
            return outStr;
        private static boolean loadData() {
            try {
                //File inFile = new File("qna.txt");
                File inFile = new File("data/qna.txt");
                FileInputStream inStream = new FileInputStream(inFile);
                byte[] data = new byte[(int)inFile.length()];
                // Read questions and answers into a byte array
                if (inStream.read(data) <= 0) {
                    System.err.println("Error: couldn't read q&a.");
                    return false;
                // See how many question/answer pairs there are
                for (int i = 0; i < data.length; i++)
                    if (data[i] == (byte)'#')
                        numQuestions++;
                numQuestions /= 2;
                questions = new String[numQuestions];
                answers = new String[numQuestions];
                // Parse questions and answers into String arrays
                int start = 0, index = 0;
                   String LineDelimiter = System.getProperty("line.separator");
                   int len = 1 + LineDelimiter.length(); // # + line delimiter
                boolean isQuestion = true;
                for (int i = 0; i < data.length; i++)
                    if (data[i] == (byte)'#') {
                        if (isQuestion) {
                            questions[index] = new String(data, start, i - start);
                            isQuestion = false;
                        } else {
                            answers[index] = new String(data, start, i - start);
                            isQuestion = true;
                            index++;
                    start = i + len;
            } catch (FileNotFoundException e) {
                System.err.println("Exception: couldn't find the Q&A file.");
                return false;
            } catch (IOException e) {
                System.err.println("Exception: couldn't read the Q&A file.");
                return false;
            return true;
        public static void main(String[] arguments) {
            // Initialize the question and answer data
            if (!loadData()) {
                System.err.println("Error: couldn't initialize Q&A data.");
                return;
            ServerSocket serverSocket = null;
            try {
                serverSocket = new ServerSocket(4413);
                System.out.println("TriviaServer up and running ...");
            } catch (IOException e) {
                System.err.println("Error: couldn't create ServerSocket.");
                System.exit(1);
            Socket clientSocket = null;
            // Endless loop: waiting for incoming client request
            while (true) {
                // Wait for a clientSocket
                try {
                    clientSocket = serverSocket.accept();   // ServerSocket returns a client socket when client connects
                } catch (IOException e) {
                    System.err.println("Error: couldn't connect to clientSocket.");
                    System.exit(1);
                // Create a thread for each incoming request
                TriviaServerMulti server = new TriviaServerMulti(clientSocket);
                Thread thread = new Thread(server);
                thread.start(); // Starts new thread. Thread invokes run() method of server.
    }This is the text file:
    Which one of the Smothers Brothers did Bill Cosby once punch out?
    (a) Dick
    (b) Tommy
    (c) both#
    b#
    What's the nickname of Dallas Cowboys fullback Daryl Johnston?
    (a) caribou
    (b) moose
    (c) elk#
    b#
    What is triskaidekaphobia?
    (a) fear of tricycles
    (b) fear of the number 13
    (c) fear of kaleidoscopes#
    b#
    What southern state is most likely to have an earthquake?
    (a) Florida
    (b) Arkansas
    (c) South Carolina#
    c#
    Which person at Sun Microsystems came up with the name Java in early 1995?
    (a) James Gosling
    (b) Kim Polese
    (c) Alan Baratz#
    b#
    Which figure skater is the sister of Growing Pains star Joanna Kerns?
    (a) Dorothy Hamill
    (b) Katarina Witt
    (c) Donna De Varona#
    c#
    When this Old Man plays four, what does he play knick-knack on?
    (a) His shoe
    (b) His door
    (c) His knee#
    b#
    What National Hockey League team once played as the Winnipeg Jets?
    (a) The Phoenix Coyotes
    (b) The Florida Panthers
    (c) The Colorado Avalanche#
    a#
    David Letterman uses the stage name "Earl Hofert" when he appears in movies. Who is Earl?
    (a) A crew member on his show
    (b) His grandfather
    (c) A character on Green Acres#
    b#
    Who created Superman?
    (a) Bob Kane
    (b) Jerome Siegel and Joe Shuster
    (c) Stan Lee and Jack Kirby#
    b#

  • Multiple Clients in Client/Server Program

    I'm currently trying to make a small Client/Server application that will mimic a very basic chat room program. The basic idea is that the Server side of the program is started and multiple Client programs can connect and communicate with each other. However, I'm having a few problems at the moment, mostly with figuring out how it can work.
    Firstly, I can communicate one to one with the server and the client as the client socket is stored in a variable. However, to make it possible to allow multiple connections I've used a thread for each new connection but I'm not sure how I can broadcast messages to every connection. Would it be safe enough to store each client socket in a list and then communicate that way? Not sure what will happen when the client disconnects though it seems to be an issue.
    I'm also not sure how every message can be broadcasted to every single connections to the server. The server program can send a message to every client but the clients message at the moment only goes to the server. Anyway here's a bit of my code so far:
    SwingWorker<Socket, Void> worker = new SwingWorker<Socket, Void>() {
            protected Socket doInBackground() throws Exception {
                // Client socket
                try {
                    while (!stopRequested) {
                        clientSocket = serverSocket.accept();
                        // Stop requested is checked twice because the accept() method
                        // waits for a connection
                        if (!stopRequested) {
                            HostFrame.getFeedbackTextArea().append("New Connection Found");
                            Thread clientThread = new HandlerThread(clientSocket);
                            clientThread.start();
                        else {
                            serverSocket.close();
                            clientSocket.close();
                catch (Exception e) {
                    HostFrame.getFeedbackTextArea().append("Failed to Connect with Client");
                    System.out.println(e.getMessage());
                return clientSocket;
        };The SwingWorker is used so that the GUI doesn't freeze when the server tries to find a connection. At the moment it just creates a thread for each new connection but I'm guessing this isn't what I'm going to be needing to handle more than one client. Also at the moment I have no way of directing a message to a specific socket I'm pretty much just using the standard method shown on the Sun website about Sockets. Any help would be much appreciated

    clientSocket = serverSocket.accept();'clientSocket' should be a local variable here.
    else {
    serverSocket.close();
    clientSocket.close();You shouldn't close 'clientSocket here'. All you're accomplishing is closing the most recently accepted client socket. What about the others? Generally speaking you should let the client-handling threads take care of their own sockets completely.
    return clientSocket;This return statement is meaningless. You may as well return null. SwingWorker doesn't care. Don't just return something because you've got it lying around. In this case you shouldn't have it lying around.
    At the moment it just creates a thread for each new connection but I'm guessing this isn't what I'm going to be needing to handle more than one client.That is exactly what you have to do to handle more than one client. Once you fix it as per above.
    Also at the moment I have no way of directing a message to a specific socket I'm pretty much just using the standard method shown on the Sun website about Sockets.You probably need to keep a Map of client sockets accepted, keyed by some client identifier.

  • Design Pattern for multithreaded client server program

    I asked this question in another post, but with other stuff, so I'll distill this one.
    I am creating a multi-threaded client server program (just for learning - a chat program at this point). I built the server and client in swing, and I'm wondering what the best design pattern is for this setup. Right now all the swing stuff is in the MyServer class. In that class I have a loop accepting client connections to the serverSocket and creating a new MyServerThread (threaded client connection).
    The problem is that all the work of creating input streams, interacting with the server, all that stuff is done in the MyServerThread class, but I want that text to be written up to the Swing objects - which is in the MyServer class. So right now in the MyServerThread class I pass the MyServer object into it, but I'm not sure if that is really the most robust thing to do. Does anybody have any suggestions as to how this should be done. If somebody has an article they'd like to point to I'll check it out too. But if it's just the run-of-the-mill multithreaded client-server article, I've read alot and most don't specifically address my question.

    Thanks for the reply Kaj, and I think I'll keep my design for now, since it's just quick and dirty. I've read the MVC concept a while ago and I'll revisit it again when I get more serious. But I have a question, why should I be using a callback interface, why an interface at all? And then make MyServer implement that interface...why not just pass MyServer to the thread object? Or is there something down the line that I did not forsee?

Maybe you are looking for

  • In plain English - How can I get music from one computer to another?

    Honestly guys, I havent a clue! I have purchased music from my work PC, but cant access it from my Home PC. I have read the manuals, but it dosent make sense to me! So, in ordinary, basic, plain English, how do I access it from home?!

  • How to store long text in transaction f-65

    Hi all, I need to add long text in the transaction f-65 for a particular document number. I have used the FM CREATE_TEXT. There are no errors but the text is not getting updated. Pointers on this will be really helpful. Regards, Praveen

  • The I-do-not-like-Firefox-29-layout topic

    '''(For Forum Moderators: Please read [/forums/forum-moderators/710264?last=59300])''' Moderators, please read first before closing/removing this topic right away?<br> To those wanting to react here on this topic: please, also read ;)<br> Since my or

  • Missing Operating System

    I have a Lenovo T500 Thinkpad.  I turned off my laptop and now when I turn on the laptop I receive a message that states "Missing operating system". I do not have any recovery disk or install disk.  How do I fix this error?  The only thing that I hav

  • How to start and shutdown Oracle Applications 11i?

    Currently, I've installed an Oracle Applications version 11i under Sun Solaris environment. However, I encountered problems when I tried to backup the whole system for fallback purpose. I'm not really sure about the procedures in shutting down the Or