Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

My first client server app lil help please

  • 22-11-2006 6:19pm
    #1
    Registered Users, Registered Users 2 Posts: 221 ✭✭


    I'm writing a client server in java . I'm really used to it so i'm having alittle trouble.

    The problem is i've got a string which i want to send from the client to the server.
    Here's what im doing :

    Client side :
    PrintWriter writer = new PrintWriter(skt.getOutPutStream());
    writer.println(Pick);

    note this is where skt is a Socket and Pick is a String.

    On the Server side i have this :
    try{

    InputStreamReader stream = new InputStreamReader(theConnection.getInputStream());
    BufferedReader reader = new BufferedReader(stream);
    System.out.println("readline is :" + reader.readLine());

    NewPick = reader.readLine();


    }catch(IOException e){
    System.out.println("Didn't get into try to read");

    }

    In this case THis code is within a run method for a thread . theCOnnection is a Socket and NewPick is a string. I'm 90% sure the problem is with the reader.readLine.


    Can anyone shed some light ??


    Thanks a million

    -Elfman


Advertisement