java network programming

java network programming PowerPoint PPT Presentation

  • Uploaded on
  • Presentation posted in: General

Netprog 2000 - Java Network Programming. 2. Java Overview. Object-orientedDeveloped with the network in mindBuilt-in exception handlingExtensive standard class library. Netprog 2000 - Java Network Programming. 3. Important Java Packages. java.netTCP/IP networkingjava.ioI/O streams

Download Presentation

java network programming

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

1. Java Network Programming Network Programming Spring 2000 Jeffrey E. Care [email protected]

2. Netprog 2000 - Java Network Programming 2 Java Overview Object-oriented Developed with the network in mind Built-in exception handling Extensive standard class library

3. Netprog 2000 - Java Network Programming 3 Important Java Packages TCP/IP networking I/O streams & utilities java.rmi Remote Method Invocation Security policies java.lang Threading classes

4. Netprog 2000 - Java Network Programming 4 Java Sockets Programming Java uses BSD-style sockets to interface with TCP/IP services ( package) Java distinguishes between UDP, TCP server & TCP client sockets Behind-the-scenes classes do the actual work & can be updated or swapped out transparently

5. Netprog 2000 - Java Network Programming 5 IP Addresses & Hostnames class Represents a single IP address Factory class no public constructor Performs transparent DNS lookups or reverse lookups thrown if DNS system cant find IP address for specific host

6. Netprog 2000 - Java Network Programming 6 TCP Server Sockets class Binds to a local port to listen for initial connections Can be bound to a local IP for multi-homed machines accept() method returns a, not an integer descriptor

7. Netprog 2000 - Java Network Programming 7 TCP Client Sockets class Combines socket with socket options (timeout, linger, keep alive, no delay, etc) Encapsulates a and a can be retrieved for use in a layered I/O system

8. Netprog 2000 - Java Network Programming 8 UDP Sockets class Java makes no distinction between client/server for UDP sockets Connected mode UDP supported in Java 2 Can be bound to both a local port & a local IP address multi-homed support Supports some socket options (timeout, buffer size)

9. Netprog 2000 - Java Network Programming 9 UDP Datagrams class Expects a byte array of data Address optional for connected-mode UDP This class is final cant be extended! instances can only send instances of

10. Netprog 2000 - Java Network Programming 10 Threading Java doesnt support the notion of forking processes; how do we support concurrency?

11. Netprog 2000 - Java Network Programming 11 Java Servlets Servlets are the Java analog to CGI Advantages of servlets: full access to other Java APIs, persistence between invocations, guaranteed portability Servlets can be generic services or specific to HTTP

12. Netprog 2000 - Java Network Programming 12 HTTP Servlets javax.servlet.http.HttpServlet class Uses HTTP to receive requests and generate responses Full support for all HTTP methods, cookies, sessions, persistent connections Servlets can be chained example: de-blink servlet

13. Netprog 2000 - Java Network Programming 13 Java Applets Client-side Java programs that run in a browser Applets have special security restrictions called the applet sandbox Only applets loaded over the network are subject to the applet sandbox The applet sandbox is controlled by a java.lang.SecurityManager

14. Netprog 2000 - Java Network Programming 14 Applet Sandbox Cant load libraries or define native methods Cant access local host filesystem Cant open sockets to hosts other than originating host Cant use Runtime.exec() Applet windows have a unique appearance Restricted access to certain system properties

15. Netprog 2000 - Java Network Programming 15 Escaping the Applet Sandbox Browsers can define their own security policy via a new security manager Applets can be signed and executed as trusted content Security policies may vary from browser to browser, even for signed applets

16. Netprog 2000 - Java Network Programming 16 Remote Method Invocation (RMI) RMI is the Java analog to RPC RMI servers use a naming service (rmiregistry) to register remote objects RMI servers use a special security policy implemented by RMISecurityManager The default RMI transport mechanism is via TCP sockets this is transparent to RMI code! Any object transferred in an RMI call must implement the Serializable interface

17. Netprog 2000 - Java Network Programming 17 Java Naming & Directory Interface (JNDI) JNDI provides a generic API that can be used to interface with any naming system JNDI uses SPIs (service provider interfaces) to access many different types of naming & directory services from the JNDI API Sun supplies JNDI SPIs for LDAP, NIS, COS (CORBA naming), RMI registry & local filesystem

  • Login