Results 1 to 2 of 2

Thread: Send class with client-server

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2003
    Posts
    10

    Send class with client-server

    Hi all,
    I am working on server-client project. I found a simple example where you send string like this:

    output = new PrintWriter(socket.getOutputStream(),true);
    output.println(lineToBeSent);

    and receive:

    input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    String message = input.readLine();

    my question is how can I send and receive a class if the class is the same in both server and client?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I recommend serialization. Object(In/Out)putStream
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width