Results 1 to 5 of 5
- 10-24-2012, 03:59 PM #1
Senior Member
- Join Date
- May 2012
- Posts
- 170
- Rep Power
- 2
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 06:11 PM.
WARNING I am Russian so it's possible that I wont understand you correctly...
- 10-24-2012, 06:10 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
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, 06:12 PM #3
Senior Member
- Join Date
- May 2012
- Posts
- 170
- Rep Power
- 2
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, 08:09 PM #4
Senior Member
- Join Date
- May 2012
- Posts
- 170
- Rep Power
- 2
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, 01:52 AM #5
Similar Threads
-
getOutputStream() has already been called for this response
By srinivasmallabathula in forum Advanced JavaReplies: 1Last Post: 07-17-2012, 12:46 PM -
Using getOutputStream() while getWriter() is open
By khkh82 in forum Advanced JavaReplies: 1Last Post: 06-06-2012, 12: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, 09:40 AM -
getOutputStream() has already been called for this response
By zuzacat in forum New To JavaReplies: 0Last Post: 06-23-2011, 12:02 PM -
getOutputStream() exception
By Freddie in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 05-15-2007, 04:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks