• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with client and server screens

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm currently using the observable and observer class/interfaces(s) to update network client server information. I have since decided against this and just wish to use a frame for the server and another one for standalone client/network client as I have found it very difficult to select correct coding events in the screens to use observer/observable pattern. I'm hoping to say do all my validation at the "start server" on server screen and "connect" buttons on client screens. Could someone give an idea of the following:
(1) How can I identify the server address (ip address) that the server runs on when running the server in order to write to the common properties file?
(2) How does the network client know the ip address and port the server is running on to know that the database location and port fields entered in the network client window are right? 1 way I think of doing this is to synchronize on the shared properties file and if server address and port number don't exist, 1 cannot start the client. In other words how does client know server is running?
Thanks very much.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,

(1) as a default I used "localhost" to write to the suncertify.properties (if it doesn't exist yet)
(2) synchronizing on the properties file is a bit hard if the server runs on computer 1 and the client on another computer in the network. how would you do that? just keep it simple: i show a dialog to enter the ip address and port number when networked client is started. If provided information is valid (= able to connect to the server) the main window of the application shows (else an error message is shown and client shuts down).

Hope it helps!
Kind regards,
Roel
 
reply
    Bookmark Topic Watch Topic
  • New Topic