Results 1 to 5 of 5
- 10-24-2012, 04:59 PM #1
Senior Member
- Join Date
- May 2012
- Posts
- 172
- Rep Power
- 9
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.
FIXEDLast edited by Lionlev; 10-24-2012 at 07:11 PM.
WARNING I am Russian so it's possible that I wont understand you correctly...
- 10-24-2012, 07:10 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 785
- Rep Power
- 12
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
- 10-24-2012, 07:12 PM #3
Senior Member
- Join Date
- May 2012
- Posts
- 172
- Rep Power
- 9
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...
- 10-24-2012, 09:09 PM #4
Senior Member
- Join Date
- May 2012
- Posts
- 172
- Rep Power
- 9
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...
- 10-25-2012, 02:52 AM #5
Similar Threads
-
getOutputStream() has already been called for this response
By srinivasmallabathula in forum Advanced JavaReplies: 2Last Post: 12-06-2014, 09:37 PM -
Using getOutputStream() while getWriter() is open
By khkh82 in forum Advanced JavaReplies: 1Last Post: 06-06-2012, 01:20 PM -
response.getOutputStream used on MySQL request throwing IllegalStateException in JSP
By blobs in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 05-11-2012, 10:40 AM -
getOutputStream() has already been called for this response
By zuzacat in forum New To JavaReplies: 0Last Post: 06-23-2011, 01:02 PM -
getOutputStream() exception
By Freddie in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 05-15-2007, 05:26 PM
Bookmarks