Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java socketºÍ¶àỊ̈߳¨Thread£©ÊµÀý

1. socketͨÐÅ£ºÓпͻ§¶ËºÍ·þÎñ¶ËµÄsocket´úÂë¡£ 
2. ¶àỊ̈߳º¿Í»§¶ËºÍ·þÎñ¶Ë¸÷ÓÃÒ»Ï̷߳¢ËÍÐÅÏ¢£»·þÎñ¶ËÁíÓÐÒ»¼àÌýỊ̈߳¬ÓÃÓڰѳ¬Ê±µÄÐÅϢɾ³ý¡£ 
    ÕâÀïÓ¦Óõ½ÁËͬ²½£¬Ê¹Á½¸öÏ߳̿ÉÒÔ²Ù×÷ͬһ¸ömap¡£ 
´úÂ룺£¨ÀàÈ«ÔÚͬһ¸ö°üÄÚ£© 
server¶Ë£º 
Java´úÂë < type="application/x-shockwave-flash" width="14" height="15" src="http://yidwo.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%0Aimport%20java.io.BufferedReader%3B%0Aimport%20java.io.InputStreamReader%3B%0Aimport%20java.io.PrintWriter%3B%0Aimport%20java.net.ServerSocket%3B%0Aimport%20java.net.Socket%3B%0Aimport%20java.util.Collections%3B%0Aimport%20java.util.concurrent.TimeUnit%3B%0Aimport%20java.util.HashMap%3B%0Aimport%20java.util.Map%3B%0A%0Apublic%20class%20ServerNet%20%7B%0A%09%2F%2F%20%E4%BB%A5%E6%AF%AB%E7%A7%92%E4%B8%BA%E5%8D%95%E4%BD%8D%20%0A%09private%20final%20static%20long%20timeLimit%20%3D%2010000%20%3B%0A%09private%20Map%3CString%2CString%3E%20map%20%3D%20Collections.synchronizedMap(new%20HashMap%3CString%2CString%3E())%3B%0A%09%09%0A%09public%20void%20ServerSocketNet()%7B%0A%09%09try%7B%0A%09%09%09%20ServerSocket%20ss%20%3D%20new%20ServerSocket(6060)%3B%0A%09%09%09%20Socket%20s%20%3D%20ss.accept()%3B%0A%09%09%09%20%2F%2F%20%E7%94%A8%E4%BA%8E%E8%8E%B7%E5%8F%96%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%BC%A0%E8%BE%93%E6%9D%A5%E7%9A%84%E4%BF%A1%E6%81%AF%0A%09%09%09%20BufferedReader%20buff%20%3D%20new%20BufferedReader(new%20InputStreamReader(s.getInputStream()))%3B%0A%09%09%09%20%2F%2F%20%E7%94%A8%E4%BA%8E%E8%8E%B7%E5%8F%96%E6%9C%8D%E5%8A%A1%E7%AB%AF%E5%87%86%E5%A4%87%E5%93%8D%E5%BA%94%E7%9A%84%E4%BF%A1%E6%81%AF%0A%09%09%09%20BufferedReader%20in%20%3D%20new%20BufferedReader(new%20InputStreamReader(System.in))%3B%0A%09%09%09%20%2F%2F%20%E5%8F%91%E9%80%81%E6%9C%8D%E5%8A%A1%E7%AB%AF%E5%87%86%E5%A4%87%E5%93%8D%E5%BA%94%E7%9A%84%E4%BF%A1%E6%81%AF%0A%09%09%09%20PrintWriter%20pw%20%3D%20new%20PrintWriter(s.getOutputStream()%2Ctrue)%3B%09%09%09%20%0A%


Ïà¹ØÎĵµ£º

JavaµÄÄÚ´æй©

JavaµÄÒ»¸öÖØÒªÓŵã¾ÍÊÇͨ¹ýÀ¬»øÊÕ¼¯Æ÷(Garbage Collection£¬GC)×Ô¶¯¹ÜÀíÄÚ´æµÄ»ØÊÕ£¬³ÌÐòÔ±²»ÐèҪͨ¹ýµ÷Óú¯ÊýÀ´ÊÍ·ÅÄÚ´æ¡£Òò´Ë£¬ºÜ¶à³ÌÐòÔ±ÈÏΪJava²»´æÔÚÄÚ´æй©ÎÊÌ⣬»òÕßÈÏΪ¼´Ê¹ÓÐÄÚ´æй©Ҳ²»ÊdzÌÐòµÄÔðÈΣ¬¶øÊÇGC»òJVMµÄÎÊÌâ¡£Æäʵ£¬ÕâÖÖÏë·¨ÊDz»ÕýÈ·µÄ£¬ÒòΪJavaÒ²´æÔÚÄÚ´æй¶£¬µ«ËüµÄ±íÏÖÓëC++²»Í¬¡£
ÎÊÌâµÄÌá ......

JAVAÄÚ´æÒç³ö½âÎö

  Ô­ÒòÓкܶàÖÖ£¬±ÈÈ磺
1.Êý¾ÝÁ¿¹ýÓÚÅÓ´ó£»ËÀÑ­»· £»¾²Ì¬±äÁ¿ºÍ¾²Ì¬·½·¨¹ý¶à£»µÝ¹é£»ÎÞ·¨È·¶¨ÊÇ·ñ±»ÒýÓõĶÔÏó£»
2.ÐéÄâ»ú²»»ØÊÕÄڴ棨ÄÚ´æй©£©£»
    ˵°×Á˾ÍÊdzÌÐòÔËÐÐÒªÓõ½µÄÄÚ´æ´óÓÚÐéÄâ»úÄÜÌṩµÄ×î´óÄÚ´æ¾Í·¢ÉúÄÚ´æÒç³öÁË¡£ ÄÚ´æÒç³öµÄÎÊÌâÒª¿´ÒµÎñºÍϵͳ´óС¶ø¶¨£¬¶ÔÓÚijЩϵͳ¿ÉÄÜÄÚ´æ ......

ٲȻÒѾ­·ÏµôÁË£¨ÖØмñÆðJava£©

·ÏÁË¡£2ÄêûÕý¾­ÓùýJavaÁË¡£ÎªÁË°ïÅóÓÑæ±ØÐëÈ«²¿¼ñÆðÀ´¡£BT¼Æ»®±»ÆÈÔÝÍ£¡£
»¹ÊǺÃÄÔ×Ó²»ÈçÀñÊÍ·¡£
¼ÇÏÂÀ´£º
Java»·¾³±äÁ¿ÉèÖãº
http://blog.csdn.net/aneka/archive/2008/09/19/2948209.aspx
ѧϰ Java ¿ª·¢µÄµÚÒ»²½¾ÍÊǹ¹½¨¿ª·¢»·¾³£¬ÏÂÃæÒÔ JDK6.0 ÔÚ Windows XP ÉϵݲװÅäÖÃΪÀýÀ´½²Êö£º
µÚÒ»²½£ºÏÂÔØ JDK
´ ......

JAVA,ÈçºÎÅжϵãÊÇ·ñÔÚÃæÄÚ£¿

Ê×ÏÈÃæÒ²ÊÇÓÉһϵÁеĵã×é³É£¬±ÈÈ磬һ¸öÕý·½ÐΡ£ÎÒÃÇ¿ÉÒÔ°ÑËüµ±³ÉËĸö×ø±êµãÈ»ºóÖ±ÏßÁ¬½Ó¶ø³É¡£
java.awt.geom.GeneralPathΪÎÒÃÇʵÏÖµÄÕâ¸ö»­ÏߵŦÄÜ¡£
ÏÂÃæÓÃÒ»¸ö¼òµ¥µÄÀý×ÓÀ´»­Ò»¸öÃæ
/**
* ½«¾­Î³¶Èµã¼¯ºÏת»»ÎªGeneralPath¶ÔÏó
*
* @param points µã¼¯ºÏ(ÓÐÐò)
*
* @return GeneralPath¶ÔÏó
*/
public s ......

windows 7µÄjava»·¾³±äÁ¿

class_path
.;D:\Program Files\Java\jdk1.5.0_04\lib\tools.jar;D:\Program Files\Java\jdk1.5.0_04\lib\rt.jar;D:\Program Files\Java\jdk1.5.0_04\lib\dt.jar;
path
D:\Program Files\Java\jdk1.5.0_04\bin;D:\Program Files\Java\jre1.5.0_04\bin
java_home
D:\Program Files\Java\jdk1.5.0_04
ÒÔÉÏÅäÖÃÊÇÎÒ»úÆ÷µ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ