vinod nar

Greenhorn
+ Follow
since Feb 09, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vinod nar

dude could you possibly change the code so that the output of the program is as i mentioned before. thanks once again
ok. my program shud do this
client:hi.
server:i received.
client:bye.

this s wat the prog shud do..
hey guys i m new to java programming. i have jdk1.6. i started on socket programming. here is the code for it
server side:

import java.io.*;
import java.net.*;
class server
{
public static void main(String[] args)
{
ServerSocket ss=new ServerSocket(5000);
Socket soc1=ss.accept();
DataInputStream in=new DataInputStream(soc1.getInputStream());
DataOutputStream out=new DataOutputStream(soc1.getOutputStream());
String msg=soc1.readUTF();
System.out.println(msg);
soc1.writeUTF("I received");
msg=soc1.readUTF();
soc1.close();
}
}

client side:

import java.io.*;
import java.net.*;
class client
{
public static void main(String[] args)
{
Socket soc=new Socket("192.168.1.2",5000);
DataInputStream in1=new DataInputStream(soc.getInputStream());
DataOutputStream out1=new DataOutputStream(soc.getOutputStream());
String mes="hi";
soc.writeUTF(mes);
String msg1=soc.readUTF();
soc.writeUTF("Bye");
soc.close();
}
}

i got the errors in read and write utf saying that cannot find the symbol. is my program correct or do i need an additional software along with jdk to run this kind of program.
p.s: this is a part of my project. so any help wil be highly appreciated... thank ya..