Pace university


Download 121.03 Kb.
Pdf ko'rish
bet27/29
Sana05.01.2022
Hajmi121.03 Kb.
#207578
1   ...   21   22   23   24   25   26   27   28   29
Bog'liq
ahujajasmine

 

Appendix 

 

A  Code for Version 1  Java™ Application Client (JDK 1.0) 



A.1 Client  

A.2 Server 

 

B  Code for Version 2  Telnet Applet Client (JDK 1.0) 



 

B.1 Client  

 

B.2 Server 



 

C  Code for Version 3  Java™ Applet Client (JDK 1.1) 

 

C.1 Client  



 

C.2 Server 

 



 

 



Client Version 1 

 

// Set up a Client that will read information sent 



// from a Server and display the information. 

import java.io.*; 

import java.net.*; 

import java.awt.*; 

 

public class Client extends Frame { 



   TextArea display

 

   public Client() 



      super( "Client" ); 

      display = new TextArea( 20, 10 ); 

      add( "Center", display );  

      resize( 300, 150 ); 

      show(); 

   } 

 

   public void runClient() 



   { 

      Socket client

      OutputStream output

      InputStream input

 

      try { 



         client = new Socket( “172.17.52.149”, 5000 );    


Download 121.03 Kb.

Do'stlaringiz bilan baham:
1   ...   21   22   23   24   25   26   27   28   29




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling