CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009
    Posts
    1

    Smile Java client-server application

    Hello!

    I have a problem. Lately I've been making a client-server application in java programming language. i managed to create it but it only works when both client and server are on the same computer (because client uses "localhost" as hostname). that project is located here:

    http://www.2shared.com/file/8358806/...er-client.html
    (save to pc link is located at bottom of the page)

    To test the project,first run the server.exe and then client.exe, after u run client.exe on server should say: "Connect", then you can chat between server and client.



    What do I need?

    I need to figure out a way so that server and client can communicate via internet over some port (in the project its 21337). in other words, client should use the internet to locate the server's computer (ip?) and then join that computer, connect to the port 21337 and start the chat with the server which is waiting for the client.

    I'd be most grateful if someone will be able to help me. Any suggestions on how to solve this is acceptable. Please help me.

    Thank you!

    Backo

  2. #2
    Join Date
    Feb 2008
    Posts
    966

    Re: Java client-server application

    You need to use Sockets. Try reading a few tutorials on how to create and listen for incoming connection via Sockets.

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