Results 1 to 5 of 5
  1. #1
    Lionlev is offline Senior Member
    Join Date
    May 2012
    Posts
    172
    Rep Power
    3

    Unhappy Problem with getOutputStream(); (HELP PLEASE)

    Hi, I've got a weird bug?
    I've made a multiclient-server and the client, and PrintWriter(Socket.getOutputStream()); seemed to send data to a wrong client...

    Basically I've made a server and if client connects, server starts a new thread class out of the socket.. then client presses a button and sends stringA to the server, after that server should send stringB to the client.

    The thing is that if client 1 connect, then client 2 connect, client 1 sends the stringA, and server sends the stringB to the client 2 instead of the client 1.

    But if client 1 will connect and send stringA, server will send him stringB, after that client 2 can connect and send the stringA and receive stringB.

    FIXED
    Last edited by Lionlev; 10-24-2012 at 06:11 PM.
    WARNING I am Russian so it's possible that I wont understand you correctly...

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    5

    Default Re: Problem with getOutputStream(); (HELP PLEASE)

    Can you show us the (relevant) code?
    Looks like the server knows only the last connected client? Do you use static maybe?:D Or or or...please show us a part of your code

  3. #3
    Lionlev is offline Senior Member
    Join Date
    May 2012
    Posts
    172
    Rep Power
    3

    Default Re: Problem with getOutputStream(); (HELP PLEASE)

    Oh damn, man, I fixed it xD It was static one xD thanks
    WARNING I am Russian so it's possible that I wont understand you correctly...

  4. #4
    Lionlev is offline Senior Member
    Join Date
    May 2012
    Posts
    172
    Rep Power
    3

    Question For mmorpg sidescroller, how many servers should i make? 1 or more?

    Should I make 2 servers? Like one for the game and coordinates and one for the chat?
    WARNING I am Russian so it's possible that I wont understand you correctly...

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,237
    Rep Power
    19

    Default Re: Problem with getOutputStream(); (HELP PLEASE)

    This was fine as a follow-on question. Posted in a new thread, it lacked context and would be virtually unanswerable.

    I've merged the new thread here.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. getOutputStream() has already been called for this response
    By srinivasmallabathula in forum Advanced Java
    Replies: 1
    Last Post: 07-17-2012, 12:46 PM
  2. Using getOutputStream() while getWriter() is open
    By khkh82 in forum Advanced Java
    Replies: 1
    Last Post: 06-06-2012, 12:20 PM
  3. Replies: 2
    Last Post: 05-11-2012, 09:40 AM
  4. Replies: 0
    Last Post: 06-23-2011, 12:02 PM
  5. getOutputStream() exception
    By Freddie in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 05-15-2007, 04:26 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
  •