PDA

Click to See Complete Forum and Search --> : Socket question


zahadumy
Nov 10th, 2006, 09:49 AM
I have a Server and a Client which communicate through a socket. The Server is a console application and the Client is an application which I have a JFrame for. I have a FClient class where I draw all the components on the form and stuff, and in the actionPerformed method , when I click a "connect" button, I call the default constructor from the Client class where I open the socket and I call some method from the Client class I use to comunicate with the server. The issue is the messages never get to the server, it hangs waiting to read something from the socket. I tried to use the Client class directly, and if I call it's contructor and methods they work, but for some reason it doesn't when I try to call them using the GUI.
I hope my question is clear enough, but if you need some code I can provide it here it my next post. Thank you.

System_Error
Nov 11th, 2006, 07:00 AM
Post the client and server portions of the code.

In the meantime, make sure both sockets are using the same port and use System.out.println statements in the catch clause to make sure an exception isn't being thrown.


EDIT: Just read your part about it not working with the GUI. It's possibly a multithreading issues, but can't say for sure without code.