LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-02-2003, 01:33 PM   #1
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
A Java Thread question


i've written a rpg/chat type of program. it's multiuser that uses threads. my question is, do i need to use a join when calling the stop method of a thread? basically i'm having this problem where if the user disconnects from the server like 5 or 6 times, the client freezes. if left to try to let the client side app finish, the whole system will freeze up.

here's the source code, if you'd like to see what i've done right now.

Server Source Code

Client Source Code

and the classes, if you just want to run it. you'll have to use the -cp flag. i guess the command could be something like:

java -cp $HOME/grime/classes grime_client.grime_client
or
java -cp $HOME/grime_server/classes grime_server.grime_server



this is pretty much my second java program and my first using threads and sockets, so i know it's probably ugly and unelegant.

Server Classes

Client Classes


edit: oops! looks like i left in some temp files in the sources archives. they're something like *.java~X where X is some number. i think they should be alright to delete.

Last edited by megaspaz; 08-02-2003 at 01:39 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run Bash scripts like thread in Java? nguyenzoro Linux - General 1 11-11-2005 02:08 AM
monitor java thread usage against o/s limits rlangsto Linux - General 1 02-11-2005 12:20 PM
java thread trouble true_atlantis Programming 1 09-21-2004 03:40 AM
Java error "Exception in thread "main" java.lang.StackOverflowError" nro Programming 1 09-04-2004 03:47 AM
Question About Thread sibtay Programming 1 08-26-2004 02:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration