Program For Server
import java.io.*;
import java.net.*;
public class MyServer
{
ServerSocket ss;
Socket s;
DataInputStream din;
DataOutputStream dout;
public MyServer()
{
try{
System.out.println("Server START......");
ss=new ServerSocket(8);
s=ss.accept();
System.out.println("Client Connected.....");
din=new DataInputStream(s.getInputStream());
dout=new DataOutputStream(s.getOutputStream());
chat();
}catch(Exception e){System.out.println(e);}
}
public void chat()throws IOException
{
String str=" ";
do{
str=din.readUTF();
System.out.println("Client Message: "+str);
dout.writeUTF("I have recieved ur message:"+str);
dout.flush();
}while(!str.equals("stop"));
}
public static void main(String arg[])
{
new MyServer();
}
}
Open console and Compile it and run it
C:\java MyServer
Client Program
import java.io.*;
import java.net.*;
public class MyClient
{
Socket s;
DataInputStream din;
DataOutputStream dout;
public MyClient()
{
try{
s=new Socket("127.0.0.1",8);
System.out.println(s);
din=new DataInputStream(s.getInputStream());
dout=new DataOutputStream(s.getOutputStream());
chat();
}catch(Exception e){System.out.println(e);}
}
public void chat()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s1;
do{
s1=br.readLine();
dout.writeUTF(s1);
dout.flush();
System.out.println("Server Message: "+din.readUTF());
}while(!s1.equals("stop"));
}
public static void main(String arg[])
{
new MyClient();
}
}
Now open a new console window and compile it an execute as follows
c:\java MyClient
hello
start your chatting now
import java.io.*;
import java.net.*;
public class MyServer
{
ServerSocket ss;
Socket s;
DataInputStream din;
DataOutputStream dout;
public MyServer()
{
try{
System.out.println("Server START......");
ss=new ServerSocket(8);
s=ss.accept();
System.out.println("Client Connected.....");
din=new DataInputStream(s.getInputStream());
dout=new DataOutputStream(s.getOutputStream());
chat();
}catch(Exception e){System.out.println(e);}
}
public void chat()throws IOException
{
String str=" ";
do{
str=din.readUTF();
System.out.println("Client Message: "+str);
dout.writeUTF("I have recieved ur message:"+str);
dout.flush();
}while(!str.equals("stop"));
}
public static void main(String arg[])
{
new MyServer();
}
}
Open console and Compile it and run it
C:\java MyServer
Client Program
import java.io.*;
import java.net.*;
public class MyClient
{
Socket s;
DataInputStream din;
DataOutputStream dout;
public MyClient()
{
try{
s=new Socket("127.0.0.1",8);
System.out.println(s);
din=new DataInputStream(s.getInputStream());
dout=new DataOutputStream(s.getOutputStream());
chat();
}catch(Exception e){System.out.println(e);}
}
public void chat()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s1;
do{
s1=br.readLine();
dout.writeUTF(s1);
dout.flush();
System.out.println("Server Message: "+din.readUTF());
}while(!s1.equals("stop"));
}
public static void main(String arg[])
{
new MyClient();
}
}
Now open a new console window and compile it an execute as follows
c:\java MyClient
hello
start your chatting now
Malatya
ReplyDeleteKırıkkale
Aksaray
Bitlis
Manisa
NİFH
Afyon
ReplyDeleteAntalya
Erzurum
Mersin
izmir
YQO
görüntülüshow
ReplyDeleteücretli show
P67U
ankara parça eşya taşıma
ReplyDeletetakipçi satın al
antalya rent a car
antalya rent a car
ankara parça eşya taşıma
S1WJ
1AF69
ReplyDeleteDüzce Evden Eve Nakliyat
Azero Coin Hangi Borsada
Muş Şehir İçi Nakliyat
Antalya Evden Eve Nakliyat
Sakarya Parça Eşya Taşıma
Bitcoin Nasıl Alınır
Bitlis Şehir İçi Nakliyat
Ordu Parça Eşya Taşıma
Çerkezköy Çekici
6B9C9
ReplyDeletereferanskodunedir.com.tr
D3E1D
ReplyDeleteosmaniye ücretsiz görüntülü sohbet
gümüşhane kadınlarla ücretsiz sohbet
yozgat sesli sohbet uygulamaları
kadınlarla görüntülü sohbet
kastamonu kadınlarla sohbet
kayseri ücretsiz görüntülü sohbet
adana telefonda canlı sohbet
canlı sohbet bedava
edirne en iyi ücretsiz sohbet siteleri
F6BB1
ReplyDeleteAdana Mobil Sohbet Siteleri
goruntulu sohbet
rastgele sohbet
parasız sohbet
mobil sohbet chat
bilecik ücretsiz sohbet sitesi
mobil sohbet sitesi
bedava sohbet
elazığ görüntülü canlı sohbet
5F407
ReplyDeletesushiswap
uniswap
pancakeswap
pudgy penguins
shapeshift
DefiLlama
layerzero
yearn finance
quickswap
That's great article. It was great to read.
ReplyDeleteJava classes in Pune
Nursing jobs in Germany for Indian nurses offer an exceptional pathway to advance professional careers in a well-regarded healthcare system. With a high demand for skilled nursing professionals, Indian nurses can find numerous opportunities in hospitals, outpatient clinics, and rehabilitation centres. These positions typically come with competitive salaries and comprehensive benefits packages, enhancing their overall attractiveness. Extensive training programs assist in adapting to the local healthcare framework, fostering confidence in the new environment. Proficiency in the German language is vital for effective patient interaction and fostering seamless teamwork with colleagues. Additionally, the emphasis on work-life balance allows nurses to enjoy personal hobbies and immerse themselves in Germany’s rich cultural heritage. This unique blend of professional development and cultural experience makes nursing jobs in Germany a rewarding choice for Indian nurses. Embrace this opportunity to contribute significantly to patient care while enjoying a fulfilling lifestyle in a vibrant society.
ReplyDeletehttps://www.dynamichealthstaff.com/nursing-jobs-in-germany-for-indian-nurses
65FA0159D5
ReplyDeletewhatsapp şov siteleri