networking with java l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Networking with Java PowerPoint Presentation
Download Presentation
Networking with Java

Loading in 2 Seconds...

play fullscreen
1 / 10

Networking with Java - PowerPoint PPT Presentation


  • 174 Views
  • Uploaded on

Networking with Java. Socket programming. The Interweb thing Al Gore invented… . Internet is a network of networks. The Internet is really people communicating. Application layers 7, 6 : email, HTTP, FTP, Telnet, file 'sharing', streaming media, VoIP remote access: VPN

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Networking with Java' - michiko


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
networking with java

Networking with Java

Socket programming

the interweb thing al gore invented
The Interweb thing Al Gore invented…
  • Internet is a network of networks.
  • The Internet is really people communicating.
  • Application layers 7, 6 :
    • email, HTTP, FTP, Telnet, file 'sharing', streaming media, VoIP
    • remote access: VPN
  • Session layer 5: connections. e.g. sockets
  • Transport layer 4: TCP, UDP
  • Network layer 3: IP, the Internet
  • Link layer 2, 1: NICs, device drivers, magic.
internet traffic
Internet traffic
  • 10% YouTube HTTP
  • 36% other HTTP
  • 37% P2P
  • 17% newsgroups, streaming, gaming, VoIP
  • In other words, mostly a waste of bits.
internet what s it good for
Internet…what's it good for?
  • For years there has been a theory that millions of monkeys typing at random on millions of typewriters would reproduce the entire works of Shakespeare…

The Internet has proven this theory to be untrue. - Anonymous

socket programming
Socket Programming

If a packet hits a pocket on a socket on a port,

and the bus is interrupted as a very last resort,

and the address of the memory makes your floppy disk abort,

then the socket packet pocket has an error to report!

fromA Grandchild's Guide to Using Grandpa's Computer by Gene Ziegler

sockets programming
Sockets programming
  • a client exchanging data with a server
  • An Internetsocket is composed of the following:
  • Protocol (TCP, UDP, raw IP)
  • Local IP address (your computer)
  • Local port (your application)
  • Remote IP address (another computer)
  • Remote port (another application)
server sockets in java
Server Sockets in Java
  • package java.net
  • ServerSocketserver = new ServerSocket(PORT); // waits for network requests.
  • Socket socket = server.accept();// waits for a connection and returns a socket
  • use java.io to exchange data
    • InputStream from socket (client)
    • OutputStream to socket (client)
client sockets in java
Client Sockets in Java
  • package java.net
  • Socketsocket = new Socket ( host, port); // waits for a connection to host on a port and returns a socket
  • use java.io to exchange data
    • InputStream from socket (server)
    • OutputStream to socket (server)
  • see PortScanner.java
url and ip addresses
URL and IP addresses
  • URL class represents aUniform Resource Locator, a pointer to a "resource" on the World Wide Web.
    • see ReadURL.java
  • InetAddress class represents an Internet Protocol (IP) address.
    • used to find out who the socket is talking to.
    • ServerSocket or Socket can .getInetAddress();
sockets programming10
Sockets Programming

see

  • EchoServer.java & EchoClient.java
    • simple two-way communication
  • EchoServerThread.java & EchoClient.java
    • multi-threaded server to handle many sets oftwo-way communication