CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 1999
    Location
    Germany
    Posts
    42

    Applet + Network Socket

    Hi,

    I have some problems with my program, maybe somebody knows a solution :

    I wrote an Client Server Applikation with Sockets. All my Code worked perfect.
    Then I take this working code and place it into an applet. But know the client doesnt find the server ? I also get no Exception. The Client programm waits at following line :


    client = new Socket(InetAddress.getByName("168.192.192.123"),5000);



    You see I try to connect to a Server (it's the same computer) The Server is also running and listening on port 5000.
    But nothing happens ? What shall I do ?

    Martin


  2. #2
    Join Date
    Sep 1999
    Location
    Madurai , TamilNadu , INDIA
    Posts
    1,024

    Re: Applet + Network Socket


    Try like this :



    client = new Socket( applet.getCodeBase().getHost() , 5000 );





    Poochi..


  3. #3
    Join Date
    Nov 1999
    Location
    Germany
    Posts
    42

    Re: Applet + Network Socket

    I tried this out, but it doesnt work ?

    The statement you mentioned return a "" String. So do I need a Web Server (e.g. Apache ) running on my local machine to test the applet ?

    Martin


  4. #4
    Join Date
    Nov 1999
    Location
    Germany
    Posts
    42

    Re: Applet + Network Socket

    Hi,

    I tried this all out and,you have to install a Web Server

    After I installed a Apache on my Windows, this all works

    Martin


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

Featured