コード例 #1
0
    /**
     *  异步结束发送
     */
    public int EndSend(IAsyncResult iar)
    {
        DelegateForSend delSend = (iar as AsyncResult).AsyncDelegate as DelegateForSend;
        int             result  = -1;

        try {
            result = delSend.EndInvoke(iar);
        }
        catch (Exception ex) {
            Debug.LogError(ex);
        }
        return(result);
    }
コード例 #2
0
    /**
     *  异步开始发送
     */
    public IAsyncResult  BeginSend(byte[] bytes, Int32 length, AsyncCallback callback, System.Object state)
    {
        DelegateForSend delSend = new DelegateForSend(Send);

        return(delSend.BeginInvoke(bytes, length, callback, state));
    }