• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Help with writing a client file

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I really don't have a good clue on how to make them communicate well and talk back and fourth. This is what i have for my client so far

the client is suppose to display in a frame with buttons for add, clear and remove. There server is all written i just am unsure on how to define everyhting in the client, maybe some help with links to examples or something. Thanks for bearing with me.
Posts: 23901
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Generally, the server application sits on a fixed network port waiting for connections from client applications. The client application then connects to the server, at a known ip address, and at the known port... I say "generally", because it is reversed with some protocols.

Since I don't know how your server was written, I will just assume that it uses the ServerSocket class. In this case, you should not use the ServerSocket class class, you should used the Socket class.

Define a Socket with the IP address and port of your server. Establish a connection via the connect() method. Get the input and output streams, via the getInputStream() and getOutputStream() methods. And use those streams to read and write to the server.

You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic