private void ResultConnect(IAsyncResult ar)
        {
            ConnectFrame connectFrame = (ar.AsyncState as ConnectFrame);
            ASSOCKDESC   desc         = new ASSOCKDESC();

            desc.createTick = connectFrame.socket.theDESC.createTick;
            desc.managedID  = connectFrame.socket.theDESC.managedID;
            desc.theSender  = connectFrame.socket.theDESC.theSender;

            try
            {
                connectFrame.socket.tcpclient.EndConnect(ar);
                theReceiver.notifyConnectingResult(connectFrame.reqID, desc, true, null);

                // 2012-09-19 bugfix PostingRead
                // 1.1 async 버전으로 업그레이드
                connectFrame.socket.enterIO();

                SocketAsyncEventArgs readEventArgs = asiomanager.RetreiveSAEA();// new SocketAsyncEventArgs();//= saeaPool.pop(); // saeaPool from the ASIOManager
                try
                {
                    readEventArgs.Completed += new EventHandler <SocketAsyncEventArgs>(IO_Completed);
                    readEventArgs.UserToken  = connectFrame.socket;
                    bool willRaiseEvent = connectFrame.socket.tcpclient.Client.ReceiveAsync(readEventArgs);
                    if (!willRaiseEvent)
                    {
                        ProcessReceive(readEventArgs);
                        // 위에서 releaseSocket이 되면, 아래 예외처리는 수행되지 않는다.
                    }
                }
                catch (Exception ex)
                {
                    // releasesocket을 수정하지 말고 각 문맥에서 releaseSAEA를 호출하자
                    if (null != readEventArgs)
                    {
                        readEventArgs.Completed -= IO_Completed;
                        asiomanager.ReleaseSAEA(readEventArgs);
                    }
                    ReleaseSocket(connectFrame.socket);
                }
            }
            catch (Exception ex)
            {
                lock (this)
                {
                    theSockets.Remove(desc.managedID);
                }
                theReceiver.notifyConnectingResult(connectFrame.reqID, desc, false, ex);
                connectFrame.socket.tcpclient = null;
            }
        }
        public int connectSocket(int reqID, ASSocket socket, string ipaddress, int port)
        {
            lock (this)
            {
                if (true == theSockets.ContainsKey(socket.theDESC.managedID))
                {
                    return((int)MyErrorCode.AlreadyPostConnect);
                }

                // 동일한 socket에 대해 connect를 또 요청할수 있으니 미리 컨테이너에 추가하고 하자.
                theSockets.Add(socket.theDESC.managedID, socket);

                ConnectFrame connectFrame = new ConnectFrame();
                connectFrame.reqID  = reqID;
                connectFrame.socket = socket;
                connectFrame.socket.theDESC.theSender = this;

                socket.tcpclient = new TcpClient(AddressFamily.InterNetwork);
                socket.tcpclient.BeginConnect(ipaddress, port, new AsyncCallback(ResultConnect), connectFrame);
            }
            return(0);
        }