For Programmers: Free Programming Magazines  


Home > Archive > Java Help > March 2006 > Help with java programmin









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help with java programmin
nsastry1@gmail.com

2006-03-26, 7:03 pm

Hi all,

I am very new to Java, I have a project to be finished in a w.
Please help me by clarifying my doubts.

1. There is a server and several clients. I should first connect the
client to server. (TCP method)
how do I do that.
2. How do I give command line arguments in the program.

Thanks,

NS

IchBin

2006-03-26, 7:03 pm

nsastry1@gmail.com wrote:
> Hi all,
>
> I am very new to Java, I have a project to be finished in a w.
> Please help me by clarifying my doubts.
>
> 1. There is a server and several clients. I should first connect the
> client to server. (TCP method)
> how do I do that.
> 2. How do I give command line arguments in the program.
>
> Thanks,
>
> NS
>


For connecting Clients to server you need to look at "Trail: Custom
Networking"
http://java.sun.com/docs/books/tuto...king/index.html with
particular attention to "Lesson: All About Sockets"
http://java.sun.com/docs/books/tuto...kets/index.html

This is from Sun's "The Really Big Index" at
http://java.sun.com/docs/books/tuto...lybigindex.html

You can look at "The Java Developers Almanac" for java.net class for
examples http://javaalmanac.com/egs/java.net/pkg.html

That will get you going..

Command line commands can be executed buy using:

Runtime.getRuntime().exec("Your command");

Samples for this at:
http://javaalmanac.com/egs/java.lan...mand.html?l=rel

I would also look at the API Docs for better understanding and
capabilities for using.

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
________________________________________
__________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Roedy Green

2006-03-26, 7:03 pm

On 26 Mar 2006 09:35:21 -0800, nsastry1@gmail.com wrote, quoted or
indirectly quoted someone who said :

>1. There is a server and several clients. I should first connect the
>client to server. (TCP method)


there are many ways to do it. The most common in the browser sends in
an HTTP request . There in no java in the client. Next most common is
a Java Applet generated the HTTP request. Next most common in the
Java Applet sets up a socket connection.

See http://mindprod.com/jgloss/cgi.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green

2006-03-26, 7:03 pm

On 26 Mar 2006 09:35:21 -0800, nsastry1@gmail.com wrote, quoted or
indirectly quoted someone who said :

>2. How do I give command line arguments in the program.


The program running on the server, if you write a minimalist server
such as http://mindprod.com/products1.html#ECHOSERVER, you put them on
the java.exe command line.

See http://mindprod.com/jgloss/javaexe.html

However, for most server applications you use a Servlet Womb of some
sort. See http://mindprod.com/jgloss/servletwomb.html
They each have their own ways of firing them up and passing parameter,
usually with configuration files.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com