Results 1 to 6 of 6
  1. #1
    duxbuz is offline Member
    Join Date
    Jan 2014
    Posts
    4
    Rep Power
    0

    Default client server output console sharing eclipse

    Hi

    I took an example from here on client server sockets: Complete Java Networking Explained with Simple Examples - Go4Expert

    and placed it in separate classes and had a single main to run it both a server then the client

    It seems ok but I cannot have the console outputs sharing the same console.

    I start the server first and this takes precedence and the client will not output to console unless I stop the restart the app after commenting out the server startup as its already running, then eclipse gives me 2 consoles I can move between


    Is it possible to have both client and server share output console?

    Thanks

  2. #2
    duxbuz is offline Member
    Join Date
    Jan 2014
    Posts
    4
    Rep Power
    0

    Default Re: client server output console sharing eclipse

    Apologies.... err I think my server is running and my client isn't as they both use the same main and they aren't threaded (which I might have to learn how to use if they are going to share the same main)

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,010
    Rep Power
    6

    Default Re: client server output console sharing eclipse

    I would find it VERY odd that a client and a server are both started from the exact same main() method; that's quite inflexible. I'd expect you to have two applications each with their own main() so you can start each one whenever you need them to; server first, client (or multiple clientS) next.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    duxbuz is offline Member
    Join Date
    Jan 2014
    Posts
    4
    Rep Power
    0

    Default Re: client server output console sharing eclipse

    I was just trying to break the example into classes, so for me it was important. Threading worked ok for me. If I hadn't tried it, I wouldn't have had to thread it. So its all good learning.

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,010
    Rep Power
    6

    Default Re: client server output console sharing eclipse

    Fair enough. But if you're playing with threading within the same application, I'd not take this as a realistic example and create a separate test setup that is more true to life. What you have now is a simulation of running multiple isolated processes by disguising them as threads, I can't imagine that by doing that you have discovered the intricate details and problems of multithreading such as the dreaded race condition and deadlock.

    And perhaps you will now say "duh, of course!" - I just want to make sure.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    duxbuz is offline Member
    Join Date
    Jan 2014
    Posts
    4
    Rep Power
    0

    Default Re: client server output console sharing eclipse

    Nope just wanted to get some help with this:

    Hi

    I took an example from here on client server sockets: Complete Java Networking Explained with Simple Examples - Go4Expert

    and placed it in separate classes and had a single main to run it both a server then the client

    It seems ok but I cannot have the console outputs sharing the same console.

    I start the server first and this takes precedence and the client will not output to console unless I stop the restart the app after commenting out the server startup as its already running, then eclipse gives me 2 consoles I can move between


    Is it possible to have both client and server share output console?

    Thanks

Similar Threads

  1. Replies: 0
    Last Post: 07-12-2011, 10:25 PM
  2. Replies: 2
    Last Post: 09-24-2010, 11:31 AM
  3. Desktop sharing server in java
    By sijitg in forum Advanced Java
    Replies: 3
    Last Post: 09-06-2010, 01:27 PM
  4. Client Server applications in eclipse
    By murthybhat in forum New To Java
    Replies: 0
    Last Post: 01-08-2010, 06:49 AM
  5. How Do You?? Get the Console Output as a GUI??
    By Lyricid in forum AWT / Swing
    Replies: 10
    Last Post: 11-20-2009, 11:35 PM

Posting Permissions

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