Search This Blog

If you like any posts in this blog then click this icon which is present under the post

Wednesday, 28 September 2011

Finding class of the IP address


Client:
import java.io.*;
import java.net.*;
import java.util.*;
class Clientip
{
            public static void main(String args[])
            {
            try
            {
                        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
                        Socket clsct=new Socket("127.0.0.1",139);
                        DataInputStream din=new DataInputStream(clsct.getInputStream());
                        DataOutputStream dout=new DataOutputStream(clsct.getOutputStream());

Tuesday, 27 September 2011

RPC and RMI operation in java


Client
import java.io.*;
import java.net.*;
import java.util.*;
class Clientrpc
{
            public static void main(String args[])
            {
            try
            {
                        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
                        Socket clsct=new Socket("127.0.0.1",139);
                        DataInputStream din=new DataInputStream(clsct.getInputStream());
                        DataOutputStream dout=new DataOutputStream(clsct.getOutputStream());

Stop and Wait in Java


Client
import java.io.*;
import java.net.*;
import java.util.*;
class Clientstop
{              public static void main(String args[])
                {try{while(true)
                                {String str1=null;
                                BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
                                Socket clsct=new Socket("127.0.0.1",139);
                                DataInputStream din=new DataInputStream(clsct.getInputStream());
                                DataOutputStream dout=new DataOutputStream(clsct.getOutputStream());

Bitstuffing in java


Client
import java.io.*;
import java.net.*;
import java.util.*;
class Clientbs
{              public static void main(String args[])
                {try{       BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
                                Socket clsct=new Socket("127.0.0.1",139);
                                DataInputStream din=new DataInputStream(clsct.getInputStream());
                                DataOutputStream dout=new DataOutputStream(clsct.getOutputStream());

File operation between client and server


File
Client
import java.io.*;
import java.net.*;
import java.util.*;
class Clientfile
{              public static void main(String args[])
                {try{
                                BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
                                Socket clsct=new Socket("127.0.0.1",139);
                                DataInputStream din=new DataInputStream(clsct.getInputStream());
                                DataOutputStream dout=new DataOutputStream(clsct.getOutputStream());
                                System.out.println("Enter the file name:");

Tuesday, 13 September 2011

Program for Hamming code & CRC in Java


HAMMING CODE :
CLIENT
import java.io.*;
import java.net.*;
import java.util.*;
import java.math.*;
class Clienthamming
{          public static void main(String args[])
            {
            try      
            {         
                        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
                        Socket clsct=new Socket("127.0.0.1",139);
                        DataInputStream din=new DataInputStream(clsct.getInputStream());
                        DataOutputStream dout=new DataOutputStream(clsct.getOutputStream());
                        int x,y,z;
                        System.out.println("Enter the no.of bits in data word:");
                        String strr=in.readLine();
                        x=Integer.parseInt(strr);
                        System.out.println("Enter the no.of redundant bits:");

Followers