File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes how  to  start in socket programming 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 "how  to  start in socket programming" Watch "how  to  start in socket programming" New topic
Author

how to start in socket programming

samrat sri harsha kavuri
Greenhorn

Joined: Jan 20, 2005
Posts: 1
hi all,

I am completely new to java. In my college i have got a chance to work in a project involving socket programming. my current status is

1) i am moderately good in C.
2) i have 2 weeks of time to learn java starting from jan 24th.

my question is
1) can anyone suggest any strategy of how go about it?
2) any nice urls/sites or books if u can suggest so that i can learn
java first would be great.
3) any other suggestions or advice would be of great help to me.

thanks in advance,
harsha.


AWAKE! ARISE! STOP NOT, TILL THE GOAL IS REACHED - SWAMI VIVEKANANDA
Catalin Merfu
Ranch Hand

Joined: May 26, 2004
Posts: 42
http://java.sun.com/docs/books/tutorial/networking/


Catalin Merfu<br /><a href="http://www.accendia.com" target="_blank" rel="nofollow">High Performance Java Networking</a>
Alexander Rudloff
Greenhorn

Joined: Jan 11, 2005
Posts: 14
get on the web and research the syntax differences that do exist between c and java, read as much as you can on OO, and go through the tutorials on suns website.

best of luck.


Certs: SCJP 1.4, RUP
Paul Santa Maria
Ranch Hand

Joined: Feb 24, 2004
Posts: 236
The Java Networking tutorial mentioned above is an excellent suggestion.

I'd also highly recommend:

Java Network Programming, 3rd Edition
Elliotte Rusty Harold; O'Reilly, 2005
ISBN 0-596-00721-3

It's an great introduction; it's an equally great in-depth reference book. Satisfaction guaranteed!
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
One thing that will make a big difference in how difficult a task you have is whether you need to create a client or server with regards to sockets. In other words, are you writing an application that will accept connections from many client applications (like a web server), or will your application be the client, talking to one server at a time (for the most part)?

Of course, if you're creating your own protocol (the "language" that the client and server use over the socket to speak to each other) you'll be writing both client and server.

As well, Java now has two methods for programming sockets: input/output streams (the old way) and channels (known as New I/O or NIO). NIO was introduced in JDK 1.4 and may not be available to you if your requirements limit you to a pre-1.4 JDK. I mention this not to confuse you but rather because the NIO classes and methods (functions) are far easier to use than streams.

Here are two more links for you. Master Merlin's new I/O classes, a JavaWorld article, introduces the NIO classes but starts with a very brief overview of the old stream usage. I found this DeveloperWorks tutorial to be pretty complete. The tutorial seemed like it would be good for beginners as it covered each piece while building a sample client-server application. Oh, the tutorial is free; you just have to register an account (also free).

Finally, if you can, you may want to post up a brief description of what you'll be working on and see what advice the ranchers have for areas on which to focus your studies.

Of course, ask questions as they arise. That's why we hang out here.

Good luck!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to start in socket programming