This document summarizes key topics related to networking in Java, including:
1) Stream sockets provide connection-oriented communication while datagram sockets provide connectionless communication using UDP.
2) URLs can be manipulated in Java by converting them to URLs and using showDocument() to display webpages.
3) Files on a web server can be read using JEditorPane and handling hyperlink clicks, displaying the contents.
4) Simple client-server applications can be created using stream sockets by establishing connections, getting input/output streams, processing data, and closing connections.
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Masoud Kalali
This session focuses on how Java EE 7 provides extensive set of new and enhanced features to support standards like HTML5, WebSockets, and Server Sent Events among others.In this session we will show how these new features are designed and matched to work together for developing lightweight solutions matching end users high expectation from a web application’s responsiveness. The session will cover best practices and design patterns governing application development using JAX-RS 2.0, Async Servlet, and JSON-P (among others) as well as iterating over the pitfalls that should be avoided. During the session we will show code snippets and block diagrams that clarify use of APIs coming from the demo application we will show at the end.
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Masoud Kalali
This session focuses on how Java EE 7 provides extensive set of new and enhanced features to support standards like HTML5, WebSockets, and Server Sent Events among others.In this session we will show how these new features are designed and matched to work together for developing lightweight solutions matching end users high expectation from a web application’s responsiveness. The session will cover best practices and design patterns governing application development using JAX-RS 2.0, Async Servlet, and JSON-P (among others) as well as iterating over the pitfalls that should be avoided. During the session we will show code snippets and block diagrams that clarify use of APIs coming from the demo application we will show at the end.
This documentation details the design of a Distributed Web content caching system in a LAN, using the SDN OpenFlow model. This system was successfully implemented on GENI (Global Environment for Network Innovations) to test the performance improvements.
This distributed web-caching helps reduce access delays of frequently requested web content (web pages, files - pdfs, images,etc.) within the LAN by more than 50% compared to a LAN without this caching system. Further, this model helps in reducing load on the access links as every repeated request need not be fetched from the main server located in some other geographical area.
The distribution of caching servers in the LAN aim at load balancing the requests and also tackle the issue of single point of failure as in a centralized caching system.
Webinar slides "Building Real-Time Collaborative Web Applications"Sachin Katariya
Key Takeaways:
1> Key technology enablers for real-time collaboration
2> Supporting open source technologies such as Node.js, WebSocket and HTML5
3> Enriching user experience with real-time collaboration
4> Demonstration of a sample real-time collaborative web application
5> Performance benchmarks
Java Network Programming getting started, Getting Started with java network programming, two tier architecture, java client server programming, core java, java to standard edition, core java, Introduction to network programming in java
This documentation details the design of a Distributed Web content caching system in a LAN, using the SDN OpenFlow model. This system was successfully implemented on GENI (Global Environment for Network Innovations) to test the performance improvements.
This distributed web-caching helps reduce access delays of frequently requested web content (web pages, files - pdfs, images,etc.) within the LAN by more than 50% compared to a LAN without this caching system. Further, this model helps in reducing load on the access links as every repeated request need not be fetched from the main server located in some other geographical area.
The distribution of caching servers in the LAN aim at load balancing the requests and also tackle the issue of single point of failure as in a centralized caching system.
Webinar slides "Building Real-Time Collaborative Web Applications"Sachin Katariya
Key Takeaways:
1> Key technology enablers for real-time collaboration
2> Supporting open source technologies such as Node.js, WebSocket and HTML5
3> Enriching user experience with real-time collaboration
4> Demonstration of a sample real-time collaborative web application
5> Performance benchmarks
Java Network Programming getting started, Getting Started with java network programming, two tier architecture, java client server programming, core java, java to standard edition, core java, Introduction to network programming in java
WebTalk - Implementing Web Services with a dedicated Java daemonGeert Van Pamel
The speaker presents a Java application that behaves like a dedicated web server and provides Web services. It runs as a standalone network daemon and only calls system and network services that are directly executed by the JVM. No other software is necessary. The URL path referenced by the clients is not referring to files. Instead it is calling other middleware services and serves as a Web service gateway. The application only requires TCP/IP and Java library programming. Because it behaves as a web server, the browser can be any client capable of interfacing with the standard HTTP protocol.
Learn about Java network programming, specifically about security, reliability, supportability, monitoring, browser cache disabling, kit building, starting the Java server process, troubleshooting and monitoring, implementing on different operating systems and platforms, and integrating with other services. Debugging server processes is difficult because there is no direct user interface. Every interaction goes via network sockets, or process signals. Remotely control the server by using the HTTP protocol, enable and disable logging, tracing, and debugging info.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
Delivering Micro-Credentials in Technical and Vocational Education and TrainingAG2 Design
Explore how micro-credentials are transforming Technical and Vocational Education and Training (TVET) with this comprehensive slide deck. Discover what micro-credentials are, their importance in TVET, the advantages they offer, and the insights from industry experts. Additionally, learn about the top software applications available for creating and managing micro-credentials. This presentation also includes valuable resources and a discussion on the future of these specialised certifications.
For more detailed information on delivering micro-credentials in TVET, visit this https://tvettrainer.com/delivering-micro-credentials-in-tvet/
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
2. Introduction
Manipulating URLs
Reading the Files on
the Server
Establishing Simple
Server Using Stream
Sockets
Datagrams:
Connectionless
Client/Server
Interaction
Topics to be covered
4. •Built – in Networking Facilities – Easy to Program
•Classes and Interfaces declared in java.net package
•Packages for Stream Based Communications and Packet
based Communication.
•Focus on C/S relationship – client requests and server
responds
•Socket Based Communications – Read from a Socket and
Write to a socket.
Introduction
5. Introduction – Stream Sockets
•Data flows between process in continuous streams
•Connection Oriented Service
•Protocol used – TCP (Transmission Control Protocol)
6. Introduction – Datagram Sockets
•Individual Packets of Information are transmitted.
•Connection Less Service – does not guarantee that
packets arrive in any particular order (May be lost or
duplicated).
•Protocol used – UDP (User Datagram Protocol)
8. Manipulating URLs
•HTTP – Hyper Text Transfer Protocol – Forms the basis of
the web
•URI – Uniform Resource Identifiers – Identify data on the
internet
•URL – Uniform Resource Locator – Locations of websites
and webpages
10. Manipulating URLs - Example
•<html> <body>
• <applet>
• <param name = "title0" value = "Java Home Page">
• <param name = "location0" value = “www.oracle.com/technetwork/java/">
• <param name = "title1" value = "Deitel">
• <param name = "location1" value = "http://www.deitel.com/">
• <param name = "title2" value = "JGuru">
• <param name = "location2" value = "http://www.jGuru.com/">
• <param name = "title3" value = "JavaWorld">
• <param name = "location3" value = "http://www.javaworld.com/">
• </applet>
•</body></html>
11. Manipulating URLs - Example
public class SiteSelector extends Japplet
{
public void init()
{ title = getParameter( "title0“ );
location = getParameter( "location0“);
try
{ URL url = new URL( location ); // convert location to URL
AppletContext browser = getAppletContext();
browser.showDocument(url);
} // end try
catch ( MalformedURLException urlException )
{ urlException.printStackTrace();
} // end catch
13. Reading a File on a Server
Swing GUI component JEditorPane - to display the
contents of a file on a webserver.
HyperLinkEvent – Event Raised when a user clicks a
Hyperlink
14. Reading a File on a Server
public class ReadServerFile extends JFrame
{
JEditorPane contentsArea;
public ReadServerFile()
{
contentsArea = new (); // create
contentsArea
contentsArea.setEditable( false );
contentsArea. (
new HyperlinkListener()
{
15. Reading a File on a Server
public void ( HyperlinkEvent event )
{
if ( event.getEventType() ==
)
{
location = .toString();
contentsArea. ( location ); ;
}
} // end method hyperlinkUpdate
} // end inner class
); // end call to addHyperlinkListener
}
}
17. Establishing Simple Server Using
Stream Sockets
Step 1 : Create a ServerSocket
Step 2 : Wait for a Connection
Step 3 : Get the Socket’s I/O Streams
Step 4 : Perform the Processing
Step 5 : Close the Connection
18. STEP – 1 : Create a Server Socket
Call the ServerSocket constructor
ServerSocket server =
new ServerSocket(portnum,quelength)
Portnum Registers available TCP port number
Quelength Max. Number of Clients that can wait
This constructor establishes the port
where the server waits for connection
from clients
19. STEP – 2 : Wait for a Connection
Program calls the ServerSocket method accept which returns a
Socket object
Socket connection = server.accept();
Socket object
Connection with the client.
Allows the server to interact with the client.
20. STEP – 3 : Get the Sockets I/O Stream
Get the I/P and O/P stream for Communications.
Server sends information to client via OutputStream
calls the method getOutputStream to get the reference
Server receives information from the client via InputStream
calls the method getInputStream to get the reference
Methods write and read of Stream objects
send / receive individual /sequence of
bytes.
21. STEP – 3 : Get the Sockets I/O Stream
ObjectInputStream input =
new ObjectInputStream(connection.getInputStream());
ObjectOutputStream output =
new ObjectOutputStream(connection.getOutputStream());
22. STEP – 4 : Perform the Processing
Client and Server communicates via
InputStream and OutputStream
23. STEP – 5 : Close the Connection
Server closes the connection via close method
24. Establishing Simple Client Using
Stream Sockets
Step 1 : Create a Socket to connect to the Server
Step 2 : Get the Sockets I/O Streams
Step 3 : Perform the Processing
Step 4 : Close the Connection
25. STEP – 1 : Create a Server Socket
Create a Socket to connect to the server
IOException – raised, If the connection fails
UnknownHostException – raised, when the system unable
to resolve the server name
26. STEP – 2 : Get the Sockets I/O
Streams
Get the references of InputStream and OutputStream
Using Socket methods getInputStream and
getOutputStream
27. STEP – 3 : Perform the processing
Client and Server communicates via the InputStream and
OutputStream.
28. STEP – 4 : Close the Connection
Closes the connection when the transmission is complete
by invoking the close method.
29. Client / Server Interaction with Stream
socket connections -
java.io.*;
java.net.*;
javax.swing.*;
public class Server extends JFrame
{
private ObjectOutputStream output;
private ObjectInputStream input;
private ServerSocket server;
private Socket connection;
public Server()
{
server = new ServerSocket( 12345, 100 );
connection = server.accept();
30. Client / Server Interaction with Stream
socket connections -
output = new ObjectOutputStream( connection.getOutputStream() );
input = new ObjectInputStream( connection.getInputStream() );
String message = "Connection successful";
output.writeObject( "SERVER>>> " + message );
output.flush();
output.close();
input.close();
connection.close();
}
}
31. Client / Server Interaction with Stream
socket connections -
public class Client extends Jframe
{
JTextField txtField;
ObjectOutputStream output;
private ObjectInputStream input;
private String message = "";
private Socket client;
public Client( )
{
client = new Socket( InetAddress.getByName( “Node-23” ), 12345 );
client = new Socket( InetAddres.getLocalHost(), 12345 );
output = new ObjectOutputStream( client.getOutputStream() );
input = new ObjectInputStream( client.getInputStream() );
message = ( String ) input.readObject();
txtField.setText(message);
output.close(); // close output stream
input.close(); // close input stream
client.close();
34. Datagrams : Connectionless Client/Server
Interaction
Connectionless Transmission
- like a mail is carried via the postal service.
- Message break into separate pieces and
sequentially numbered.
- Letters may arrive in order or not.
-Receiver reassembles the pieces into sequential
order
Protocol - UDP
35. Datagrams : Connectionless Client/Server
Interaction – SERVER class
DatagramPackets : Packets used to send and receive
information.
DatagramSocket : Sends and Receives the packets.
SocketException : if the DatagramSocket constructor fails
to bind to the port
36. Datagrams : Connectionless Client/Server
Interaction – SERVER class
import java.net.*;
import java.io.*;
import javax.swing.*;
public class Server extends JFrame
{ JTextArea txtarea;
public Server()
{
Txtarea = new JTextArea(10,40);
socket = new DatagramSocket( 5000 );
byte[] data = new byte[ 100 ]; // set up packet
DatagramPacket receivePacket =
new DatagramPacket( data, data.length );