Microsoft Visual J++. Java


DatagramServer - 2


// ,

SrcPort = pinp.getPort();

 

//

 

//

String str = new String(buf, 0);

 

// ,

StringTokenizer st;

st = new StringTokenizer(str, "\r\n");

str = new String((String)st.nextElement());

 

//

System.out.println("> " + str + " < " +

"port: " + SrcPort);

 

// 'quit',

if(str.equals("quit"))

break;

}

 

//

s.close();

 

}

catch(Exception ioe)

{

System.out.println(ioe.toString());

}

try

{

System.out.println(

"Press <Enter> to terminate application...");

 

System.in.read(bKbdInput);

}

catch(Exception ioe)

{

System.out.println(ioe.toString());

}

}

}