This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Java Socket Programming

 
Greenhorn
Posts: 16
Eclipse IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic