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

JAVA NIO TCP SOCKET ÁÄÌìȺ·¢(²¢·¢¶àÏß³ÌдÏûϢƪ)

·þÎñÆ÷ÖÐתÏûÏ¢£¬ÊÇ·ÑʱµÄÊ£¬¿ÉÒÔ¼ÓÈë¶àÏ̡߳£ÕâÑùÒÔÀ´£¬»á²úÉúºÜ¶àÏ̡߳£¿ÉÒÔÔËÓÃÏ̳߳ØÀ´¹ÜÀí¡£
ÕâÀïÔËÓÃjava.util.concurrent°üµÄExecutors.newCachedThreadPoolÀ´¹ÜÀí¡£
·Ï»°ÉÙ˵£¬ÉÏ´úÂ룺
·þÎñÆ÷¶Ë£ºMySocketServer.java
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kevin.nio;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Date;
import java.util.Iterator;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author kevin
 */
public class MySocketServer implements Runnable{
  
    private boolean running;
   
    private Selector selector;
    String writeMsg;
   
    SelectionKey ssckey;
    ExecutorService exec;
   
    public MySocketServer(){
       
        running=true;
        exec=Executors.newCachedThreadPool();
    }
   
    public void init(){
        try {
            selector = Selector.open();
            ServerSocketChannel ssc = ServerSocketChannel.open();
            ssc.configureBlocking(false);
            ssc.socket().bind(new InetSocketAddress(2345)


Ïà¹ØÎĵµ£º

JavaÖм¯ºÏÈÝÆ÷ÀàListºÍSetµÄÓ÷¨

ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1  List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......

IBM FileNet Content Java API ¼ò½é

2008 Äê 6 ÔÂ 24 ÈÕ
Ô­ÎĵØÖ·£º http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0806wangys/
±¾ÎĽéÉÜ IBM FileNet P8 4.0 Platform ÌṩµÄ Content Java API¡£Ê×ÏÈ¶Ô FileNet P8 Content Engine ºÍ API ½øÐиÅÒª½éÉÜ, ²¢ËµÃ÷ÁËһЩ»ù±¾¸ÅÄËæºóÏêϸ½éÉÜÁË FileNet Content EngineÌṩµÄ»ùÓÚ EJB ......

ʹÓÃEclipseÓëAnt½øÐÐjava³ÌÐò¿ª·¢

ÏàÐÅ´ó¼ÒÒѾ­¶ÔEclipseµÄʹÓÃÓÐÒ»¶¨µÄ¾­Ñé,ÔÚ±àдjavaÔ´´úÂëÊǼþÌý×ÔºÀµÄÊÂ,´óÒª±àÒëÒ»´óÅújavaÔ´´úÂëȴʵ¼ù±È½Ï¿àÄÕµÄÊÂÇé,Èç¹ûÒ»¸öÒ»¸öµã"run"È¥±àÒëʵÔÚÌ«ÀË·Ñʱ¼äÁË.ÏëÍÑÀë"¿àº£",ÏÖÔھ͸ú×ÅżÃÇÒ»Æë×ß°É,²½ÈëAntµÄʹÓÃÀú³Ì.
    1.°²×°Ant
    a.ʹÓÃEclipse.3.2°æ±¾×Ô´øµÄAnt¿ÉÒÔÊ¡È ......

Java±à³Ìʵ¼ùÓ¦ÓãºJ2EE¼Ü¹¹µÄ6¸ö×î¼Ñʵ¼ù


2008-04-26 09:25 ×÷Õߣºsuperman À´Ô´£ºÈüµÏÍø
[ÕªÒª] Ê×ÏÈ£¬±¾ÎĵÄÄ¿±ê¶ÁÕßÊÇÕýÔÚ´Óʼ¼Êõ¹¤×÷µÄ¼Ü¹¹Ê¦¡£±ÜÃâ½²ÊöһЩ³Â¸¯µÄ×î¼Ñʵ¼ù£¬ÀýÈç"ÈÕ³£¹¹½¨£¨build daily£©"¡¢"²âÊÔÒ»ÇУ¨test everything£©"ºÍ"¾­³£¼¯³É£¨ integrate often£©¡£ ÈκξßÓгÆÖ°¼Ü¹¹Ê¦µÄÏîÄ¿¶¼Óзֹ¤Ã÷È·µÄ¡¢¶¨ÒåÁ¼ºÃµÄÍŶӽṹ¡£ËûÃÇ»¹Îª½øÐбà ......

²ÉÓÃJavaµÄÀà½øÐÐmd5¼ÓÃÜ

´úÂëÈçÏ£º
package com.test.j2se;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5 {
/**Êý¾Ý¼ÓÃÜ
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
MessageDigest code = MessageD ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ