logo

Client Server System for Socket Programming | Desklib

Develop a secure communication system for the Rebellion using client and server programs.

18 Pages1451 Words253 Views
   

Added on  2022-08-10

About This Document

This article explains about Client Server System for Socket Programming. It includes program overview, program description, explanation with code, output, and figures.

Client Server System for Socket Programming | Desklib

Develop a secure communication system for the Rebellion using client and server programs.

   Added on 2022-08-10

ShareRelated Documents
Running head: CLIENT SERVER SYSTEM
Client Server System
Name of the Author
Name of the University
Author Note
Client Server System for Socket Programming | Desklib_1
CLIENT SERVER SYSTEM
1
Table of Contents
Program Overview:..........................................................................................................................2
Program Description:.......................................................................................................................2
Explanation with Code :..................................................................................................................2
Output:...........................................................................................................................................14
Figure 1......................................................................................................................................15
Figure 2......................................................................................................................................15
Figure 3......................................................................................................................................16
Figure 4......................................................................................................................................17
Client Server System for Socket Programming | Desklib_2
CLIENT SERVER SYSTEM
2
Program Overview:
This is a Client Server application. First it will get response from the server after that
client will reply the message based on the server response. During conversation there have
limited user so they can talk each other until the conversation is end. Finally it will encrypt or
decrypt data along with time and date constraints. This will work in such a cycle order.
Program Description:
There is two package. One package name is com.project for the getting client and server
information. First user have to run the KnockKnockServer.java this java file is for calling the
server side based on the localhost. Then user have to run the KnockKnockClient.java once the
server side is invoking the client side based on the knock the message. Based on the knock
knock message then user can interchange conversion between each other. There are different
user like Bob and Alice etc. Then user have to press. For date and time the package name is
com.assignment for the getting client and server information. Client can entered the date value
and it shows date and when tyoe the time current time is shown in the console.There is another
class RSA example which will use to encrypt and decrypt default message.
Explanation with Code :
Client server application program have two package com.project and com.assignment. In
the com.project package first run the knockknockserver.java file it is use for call the
server.
package com.project;
import java.net.*;
Client Server System for Socket Programming | Desklib_3
CLIENT SERVER SYSTEM
3
import java.io.*;
public class KnockKnockServer {
public static void main(String[] args) throws IOException {
/* if (args.length != 1) {
System.err.println("Usage: java KnockKnockServer <port number>");
System.exit(1);
}*/
int portNumber = 4444;
try (
ServerSocket serverSocket = new ServerSocket(4444);
Socket clientSocket = serverSocket.accept();
PrintWriter out =
new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(
Client Server System for Socket Programming | Desklib_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Client and Server Application | Report
|16
|1570
|21

Code for Proxy Cache Assignment - Desklib
|7
|1720
|105

Program Description | Document
|15
|1603
|24

Client Server Programming Using RSA
|9
|1136
|384