示例#1
0
        //------------------ Sync Interfaces ------------------//

        public bool Connect()
        {
            if (sock != null)
            {
                LogUtil.Debug("ClientSocket.Connect: close first");
                return(false);
            }

            IPEndPoint remoteEP = null;

            initSocket(out remoteEP);

            try {
                sock.Connect(remoteEP);
                return(true);
            }
            catch (SocketException e)
            {
                LogUtil.ErrorFormat("ClientSocket.Connect: {0}", e.ToString());
            }

            return(false);
        }