Article View: borland.public.jbuilder.java.api
Article #767GUI freezing / Socket Server
From: Lenti
Date: Thu, 09 Jan 2003 21:36
Date: Thu, 09 Jan 2003 21:36
37 lines
1976 bytes
1976 bytes
Here's my problem and I am stumped, partly due to my lack of JAVA
knowledge at the current time. I have an application which starts a
socket server and waits for clients to connect. Once connected, the
server queries XML to the client for display.
My problem is when I start the server my GUI freezes. I have a simple
GUI made in JBuilder with a start button on it. Although the server is
running fine and the application 'works' the GUI freezes and I have to
CTRALTDEL to close the app.
The method below (after message) is in the main Application.java class
and my GUI is being created in the Frame.java class. The Frame class
has a listener for the button press which calls startServer in
Application.
Any suggestions would be helpful.
Thnaks.
public static void startServer() {
try{
int intPort=9999;
ServerSocket server = new ServerSocket(intPort);
System.out.println("Server started...waiting for clients.");
while(true){
Socket objSocket = server.accept();
SocketClient client = new SocketClient(objSocket);
client.start();
}
}
catch(IOException ioe){
//dump error
}
}
Technical Details
Message-ID:
<1cdb6144.0301091336.5d521ef0@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,19b754adc7f35a23,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2003-01-09 13:36:51 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: lenti_muitnep@yahoo.com (Lenti) Newsgroups: borland.public.jbuilder.java.api Subject: GUI freezing / Socket Server Date: 9 Jan 2003 13:36:51 -0800 Organization: http://groups.google.com/ Lines: 37 Message-ID: <1cdb6144.0301091336.5d521ef0@posting.google.com> NNTP-Posting-Host: 216.153.173.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1042148211 31428 127.0.0.1 (9 Jan 2003 21:36:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 9 Jan 2003 21:36:51 GMT