Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Socket Programming  RSS feed

 
Ravi Vanamala
Greenhorn
Posts: 16
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to write a socket program for connecting the server and get the information from that. plz help me how to write the code.......!please...!
Thanks n Regards
Ravi
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to make a million dollars next week using only a can of dried tea leaves and some old newspaper. Please help me how to do this!

Um, no. Start by browsing the JavaDocs of the java.net package, specifically java.net.Socket. You use a Socket to connect to a server (specifying IP address and port). Once connected, you can use the Socket's InputStream and OutputStream to send data to and retrieve data from the server.

The class is pertty easy to use as there's not much to it. Write a small program to test what you've learned. The ServerSocket class allows you to create your own server.

Once you've gotten your feet wet with those, write up exactly what you want to do, try to do it, and then come back here and post specific questions about any troubles your having.

There's no way any human can possibly answer your open-ended question as is.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
read and learn: http://www.oreilly.com/catalog/javanp3

And don't expect others to do your (home)work for you, especially if you aren't even able to describe what it is...
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've had great luck with Google for new APIs that I haven't used before. Search for "Java <topic> tutorial" and you'll almost always find gold. Try "Java sockets tutorial" and pick the one from Sun.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!