CS 335/535 Web Programming - Java Network Programming
java.net Classes
- ContentHandler - converts data from a URLConnection to an object [invoked from URL.getContent() and URConnection.getContent()]
- DatagramPacket - encapsulates a datagram packet
- DatagramPacket (byte packetData[], int packetLength, inetAddress internetAddress, int port)
- DatagramSocket - encapsulates a datagram socket
- DatagramSocket (int port)
- InetAddress - encapsulates Internet addresses; used to info such as host name and port address
- equals - returns true if this InetAddress has the same Internet address as the parameter
- getAddress - returns the raw IP address in network byte order
- getAllByName - returns an array of all InetAddress objects for the given hostName
- getByName - returns an InetAddress object for the given hostName
- getHostName - returns the host name for this InetAddress
- getLocalHost - returns an InetAddress for the local host
- toString - returns a String showing the IP address for this InetAddress
- ServerSocket - encapsulates a server socket [must use SocketImpl to implement the actual Socket operation policies]
- ServerSocket(int port[, int time])
- Socket - encapsulates a client socket [must use SocketImpl to implement the actual Socket operation policies]
- Socket(String hostName, int port[ boolean isStream])
- Socket(InetAddress address, int port[ boolean isStream])
- SocketImpl - implements the actual socket operation policies for Socket and ServerSocket classes
- URL - encapsulates a Uniform Resource Locator [once the object has been created, its fields cannot be changed]
- URL ([URL context,] String urlSpec)
- URL (String protocol, String host, [int port,] String file)
- URLRequestor
- URLConnection - encapsulates an active connection to an object represented by a URL
- URLConnection(URL url) protected
- URLEncoder - changes Strings of text into an x-www-form-url encoded format
- URLStreamHandler - encapsulates URL stream openeres
Examples (The class files for those examples which are not applets, can also found in the share drive network programming on Jaring) [these all require the Java compiler to run]
- Manipulating URLs - SiteSelector
- Using a URL Stream Connection - Reading a File on a Server
- Communicating with CGI Programs Through GET - calling a Lycos search engine
- URL Requestor
- Look for open ports
- finger
- Client - Server Using Stream Sockets
- TicTacToe game: server & client
NetTools (written in Java)