Meaningless Drivel is fun!*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes network connectivity? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "network connectivity?" Watch "network connectivity?" New topic
Author

network connectivity?

s yucel
Greenhorn

Joined: Dec 04, 2005
Posts: 11
Hi all,
I have chosen using plain socket and object serializtion. So, I will have a server socket running at the server side. My question is can I use a random port number and if it is already used? I am thinking to go on to the next port number until finding available one? Am I right or there is no need?
Also I am thinking to write the IP address and port number so that the client gets them to connect to the proper server socket?
can anybody please confirm me?
any idea highly appreciated
Kind regards,
hatim osman
Ranch Hand

Joined: Jun 10, 2005
Posts: 105
Hi there
I am too happy to hear that you are also doing a Socket based solution (I thought that I am the only one). You should allow the user to configure the port number thru a GUI configuration window at start up. As the assignment instructed, you should read the previous port number from a property file along with other settings. Hope this help. I am done with everything except the Client window, I had been busy for almost a month, but I am back in business now. Wish you all the luck and hope to hear from you soon.

Hatim
s yucel
Greenhorn

Joined: Dec 04, 2005
Posts: 11
Hi,
thank you very much for the quick response.
Still I am not sure what to do with IP address and port number.
So, if the examiner wants to run the server on a remote PC, then
initially, he needs to run the client GUI, change the IP address and PORT number , and then run the server on that remote pc. By the way, the client will get the address/port from the conf. files...Am I right with
all these things?
Actually I have one more question confusing me. I would like to clear.

java -jar <path+filename> mode
if mode==server , then just only the server will run,
if mode==alone then without server the client will run itself
if mode is empty then GUI will run and connect to the server ?
And the main class that directing to the proper classes will be defined
in the Manifest dir of the jar file called Main-Class:....?

any confirmation is highly appreciated

Kind regards,

syucel
Sanjay Mistry
Greenhorn

Joined: Oct 30, 2005
Posts: 17
Hi,

I am busy with B&S version 2.3.1. I, too, am using the serialization over simple socket.

The assignment say that GUI must be used to configure. Meaning, you may have one GUI to configure networked-client and the database server or have different GUI. I have chosen the later.

The assignment also mention the name of the conf file "suncertify.properties". If the file does not exist then default to something appropriate. The user may or may not change these defaults. These values must then update the properties file for the next time.

I think the appropriate default IP address in the networked-client config GUI should be either "localhost" or "127.0.0.1". Where as port number should be any between 1000 - 99999. I'd say 1234 is quite ok.



java -jar <path+filename> mode
if mode==server , then just only the server will run,
if mode==alone then without server the client will run itself
if mode is empty then GUI will run and connect to the server ?
And the main class that directing to the proper classes will be defined
in the Manifest dir of the jar file called Main-Class:....?


Your understanding of modes are correct. However, you should not edit the Manifest, the tool used to create the "executable jar" will do the necessary. The IDE your are using must have functionality to create an executable jar.

Hope this helps.

Regards
Sanjay


Java Rules....<br />SCJP 1.4, SCJD 1.4, busy with SCJWCD, after that SCBCD...
hatim osman
Ranch Hand

Joined: Jun 10, 2005
Posts: 105
Hi..
Everything being said in the previous post is ok...and you should follow that. however I have some remarks regaring this:

he needs to run the client GUI, change the IP address and PORT number , and then run the server on that remote pc.


Watch out!!! the assessor doesn't have to run anything except the executable jar file "There is only one program to be executed". I recommend that whether the properties file exists or no, the GUI configuration window should pop up with defaults if present.

Hatim
hatim osman
Ranch Hand

Joined: Jun 10, 2005
Posts: 105
Hi..
Everything being said in the previous post is ok...and you should follow that. however I have some remarks regaring this:

he needs to run the client GUI, change the IP address and PORT number , and then run the server on that remote pc.


Watch out!!! the assessor doesn't have to run anything except the executable jar file "There is only one program to be executed". I recommend that whether the properties file exists or no, the GUI configuration window should pop up with defaults if present.
I wonder why the manifest file cannot be created manually???

Hatim
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: network connectivity?
 
Similar Threads
socket programming on 2 ports
Forward Socket to another server socket
socket.close
java.net Socket port number question
VB Socket to Java Socket