• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Socket and URL's!

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
To make connection between server and client, I have to use both means Sockets and URL's? Or I can use any of them. What differnce between URL's and Sockets...
Thanks
Angela
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the server supports a protocal that URL recognizes (ftp or http), you can use URL to create a URLConnection to it(which really winds up being a socket connection usually to port 80 for http and port 21 for ftp on the server). It will take care of some of the protocal specific communiction for you.
Sockets can be used at any time. If you use a socket client to contact an http server, you have to handle some of the details that URL already does (like sending a get when you request a page). Using a socket does allow you to handle the communication in your own way if you don't wish to use one of the established protocals.
For more detail check out Custom Networking tutorial
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Carl Trusiak
Thanks a lot! I want to what is port? and how can I know which port number I have to use means whether it is low or high ?
Thanks in advance,
Angela

Originally posted by Carl Trusiak:
If the server supports a protocal that URL recognizes (ftp or http), you can use URL to create a URLConnection to it(which really winds up being a socket connection usually to port 80 for http and port 21 for ftp on the server). It will take care of some of the protocal specific communiction for you.
Sockets can be used at any time. If you use a socket client to contact an http server, you have to handle some of the details that URL already does (like sending a get when you request a page). Using a socket does allow you to handle the communication in your own way if you don't wish to use one of the established protocals.
For more detail check out Custom Networking tutorial


 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps this post can help a little. http://www.javaranch.com/ubb/Forum33/HTML/000974.html
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Carl,
Thanks a lot!
Regds
Angela

Originally posted by Carl Trusiak:
Perhaps this post can help a little. http://www.javaranch.com/ubb/Forum33/HTML/000974.html


 
reply
    Bookmark Topic Watch Topic
  • New Topic