aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes a total newbie in Sockets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "a total newbie in Sockets" Watch "a total newbie in Sockets" New topic
Author

a total newbie in Sockets

Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
hi there..
i am an IT student...
2nd year college.
we were given a project of a simple chat program that will run through the LAN
i tried and searched google for the API of java.net and it makes me feel like im heading to a huge wall that is a kilometer thick.
i mean, its really put my head into complete ache.
can you suggest me some quite simple examples and snippets on how to start this project..

ps. all i need is about the import java.net.*; and its functions essential to the chat program that i will be making.
GUI is not a matter for me because i guess i already have enough knowledge on it.

thanks.
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
Hi Jhedzkie,

Writing a simple chat application is easier that it seems, believe me! There are a lot of good tutorials (java socket tutorial), here you'll find a tutorial with code samples!


OCJP 6 (93%)
Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
Lorand Komaromi wrote:Hi Jhedzkie,

Writing a simple chat application is easier that it seems, believe me! There are a lot of good tutorials (java socket tutorial), here you'll find a tutorial with code samples!


hi there.
thanks for the response..

i went to some more research and came out with these to classes that i copied and tried to study.....

the provider [server]


and the requester [client]


its working, but i just want to know how to make it interactive?

i mean, the communication is got from the input of the user.
because, as i can see in these codes, the exchange here is built in the program and ends with "bye."
i want it to accept user inputs to make it an interactive chat..

i already tried the BufferedReader but i cant seem to understand where to put it there..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a total newbie in Sockets