Click here to Skip to main content
15,915,094 members
Home / Discussions / Java
   

Java

 
GeneralRe: Chat Server Issue Pin
Member 93392916-Aug-12 16:11
Member 93392916-Aug-12 16:11 
GeneralRe: Chat Server Issue Pin
pasztorpisti6-Aug-12 19:55
pasztorpisti6-Aug-12 19:55 
GeneralRe: Chat Server Issue Pin
Joshua Waring7-Aug-12 0:17
Joshua Waring7-Aug-12 0:17 
GeneralRe: Chat Server Issue Pin
pasztorpisti7-Aug-12 0:23
pasztorpisti7-Aug-12 0:23 
GeneralRe: Chat Server Issue Pin
Joshua Waring7-Aug-12 1:07
Joshua Waring7-Aug-12 1:07 
GeneralRe: Chat Server Issue Pin
pasztorpisti7-Aug-12 1:42
pasztorpisti7-Aug-12 1:42 
GeneralRe: Chat Server Issue Pin
Joshua Waring8-Aug-12 0:10
Joshua Waring8-Aug-12 0:10 
GeneralRe: Chat Server Issue Pin
pasztorpisti7-Aug-12 0:52
pasztorpisti7-Aug-12 0:52 
OK, here are a few suggestions:

1. I see you are coming from C because you declare all your function local variables at the beginning of the functions (sorry, methods). Declare your variables where you use it, or at least most most-inner scope where you need it.

2. Room does not have to implement the Runnable interface and you dont have to create a new thread for the room in your main(), call the run() method directly and execute it with the main thread.

3. The biggest mistake that causes the nullpointer is in Client.newThread: you should pass in this instead of new Clients(). I would do the work of Client.newThread in the constructor of Client and would create Client only after accepting the socket.
GeneralRe: Chat Server Issue Pin
Joshua Waring7-Aug-12 1:57
Joshua Waring7-Aug-12 1:57 
GeneralRe: Chat Server Issue Pin
pasztorpisti7-Aug-12 2:33
pasztorpisti7-Aug-12 2:33 
GeneralRe: Chat Server Issue Pin
Joshua Waring7-Aug-12 3:18
Joshua Waring7-Aug-12 3:18 
GeneralRe: Chat Server Issue Pin
pasztorpisti7-Aug-12 3:50
pasztorpisti7-Aug-12 3:50 
Questionplease help Pin
Mohammed Kherfan5-Aug-12 0:25
Mohammed Kherfan5-Aug-12 0:25 
AnswerRe: please help Pin
Richard MacCutchan5-Aug-12 1:21
mveRichard MacCutchan5-Aug-12 1:21 
AnswerRe: please help Pin
wo_buhui6-Aug-12 23:18
wo_buhui6-Aug-12 23:18 
Questioninteracting with parent Pin
JR2122-Aug-12 7:11
JR2122-Aug-12 7:11 
AnswerRe: interacting with parent Pin
Nagy Vilmos2-Aug-12 20:40
professionalNagy Vilmos2-Aug-12 20:40 
GeneralRe: interacting with parent Pin
JR2122-Aug-12 21:09
JR2122-Aug-12 21:09 
GeneralRe: interacting with parent Pin
Nagy Vilmos2-Aug-12 21:19
professionalNagy Vilmos2-Aug-12 21:19 
QuestionI want help Pin
Mohammed Kherfan1-Aug-12 22:47
Mohammed Kherfan1-Aug-12 22:47 
AnswerRe: I want help Pin
Andrei Straut1-Aug-12 23:03
Andrei Straut1-Aug-12 23:03 
QuestionThorwing Exception to the calling function from other class Pin
muhammed_k31-Jul-12 23:00
muhammed_k31-Jul-12 23:00 
GeneralRe: Throwing Exception to the calling function from other class Pin
Andrei Straut31-Jul-12 23:38
Andrei Straut31-Jul-12 23:38 
AnswerRe: Thorwing Exception to the calling function from other class Pin
Nagy Vilmos1-Aug-12 20:08
professionalNagy Vilmos1-Aug-12 20:08 
GeneralRe: Thorwing Exception to the calling function from other class Pin
muhammed_k2-Aug-12 6:43
muhammed_k2-Aug-12 6:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.