Results 1 to 2 of 2

Thread: Socket question

  1. #1

    Thread Starter
    Addicted Member zahadumy's Avatar
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    187

    Socket question

    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.
    The first step in solving a problem is to define the problem clearly.

    -----
    Icons | EZIconConverter | Popup Messages
    101 samples: 2003 2005
    Code converter: C# -> VB .NET | VB .NET -> C# | VB .NET <-> C#


    -----
    Visual Studio 2005/.NET Framework 2.0

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Socket question

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width