> > Hello friends,
> > I need your help to solve the socket programming
[quoted text clipped - 8 lines]
>
> See:http://java.sun.com/docs/books/tutorial/networking/sockets/index.html
for that you have to write two programs like this..
server program :
import java.net.*;
import java.io.*;
public class servereg{
public static void main(String s1[])throws IOException{
ServerSocket s=null;
Socket con=null;
PrintWriter pr=null;
BufferedReader br=null;
try{
s=new ServerSocket(5000);
con=s.accept();
}catch(Exception e){
e.printStackTrace();}
pr=new PrintWriter(con.getOutputStream());
br=new BufferedReader(new InputStreamReader(con.getInputStream()));
String msg;
while((one=br.readLine())!=null){
System.out.println("msg:"+one);
}
con.close();
}
}
Andrew Thompson - 10 Apr 2007 08:25 GMT
..
(nish)
>> > ..socket programming
..
(SadRed)
>> See: http://java.sun.com/docs/books/tutorial/networking/sockets/index.html
>
>for that you have to write two programs like this..
>server program :
What makes your code better than the examples linked
from the URL that was listed by SadRed?

Signature
Andrew Thompson
http://www.athompson.info/andrew/