コード例 #1
0
        public virtual void Open(IPEndPoint ep, bool beginReceiving, int sendTimeout, int recvTimeout)
        {
            // create a new tcp based stream socket
            _socket = HttpUtils.CreateTcpSocket(true, sendTimeout, recvTimeout);

            Debug.WriteLineIf(_verbose, string.Format("Opening Tcp connection '{0}' to '{1}'.", _id, ep.ToString()), MY_TRACE_CATEGORY);

            // connect to the remote end point
            _socket.Connect(ep);

            // begin the connection
            this.BeginSession(beginReceiving);
        }