• Post Reply Bookmark Topic Watch Topic
  • New Topic

inner methods??  RSS feed

 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i want to make a thread that does the same thing the main server does,
but for each indivual 'game' object..

but in there is a 'handleMessageFromClient(ConnectionToClient client, object msg)' method that i need to use inside the thread.

could i do the following?



wait wait wait...

how do i go about creating a separate, yet parallell, 'server' when,
everytime a client 'sendToServer(msg)' it's going to be sent to the main
server?

if i do create a separate thread, how to i get the two clients that are in
that game, just send to that thread??

Justin
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that what you would do is make a constructor of GameThread() that takes msg as a parameter. Then you would create one GameThread for each instance of GameThread using the "new" operator. After creating each thread, you would call gameThread.start().

-- Kaydell
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again.

I think that you are trying to nest method like you can do in Pascal. You con't do that. You can define inner classes though with methods, but that is something different.

-- Kaydell
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!