How to control the timeout for StreamSocket.ConnectAsync(), and StreamSocketListener.AcceptAsync()?

    I can not file API to do this.Ray_ni

Hi Ray,
Here is a simple sample...
async void btnGetData_Click(object sender, RoutedEventArgs e)
// separated all this out so it is clearer:
//Create a socket
StreamSocket aSocket = new StreamSocket();
//Cancellation token is inspected to determine if the async method should be cancelled
CancellationTokenSource cts = new CancellationTokenSource();
//In this case, after 2 seconds... signal cancel
cts.CancelAfter(2000);
//get the operation
StreamSocketConnectOperation op = aSocket.ConnectAsync(new Windows.Networking.HostName("localhost"), "22112", SocketProtectionLevel.PlainSocket);
//Create a task and pass the cancellation token
Task aTask = op.StartAsTask(cts.Token);
try
//kick off the task and wait for a result!
await aTask;
catch(TaskCanceledException tcEx)
string a = "Task Cancelled: " + tcEx.Message;
catch(Exception theEx)
string b = "Exception: " + theEx.Message;
finally
string c = "done, still might have had an exception though";
Enjoy!
-Jeff
Jeff Sanders (MSFT)

Similar Messages

  • How to control the permission for reports in share folder?

    Hi Experts,
    In OBIEE 11.1.1.6.0.
    I have created two folders in share folder,one is sales folder which contains some sales reports,and the other is dashboard folder which contains some dashboard pages that have these sales reports.
    So I want to new users who do not access the sales folder, but can view the sales reports in dashboard pages.
    How to control the permission for reports in share folder? Thanks for your help.
    Note: Dashboard pages have whole sales reports for showing.

    Hi User,
    1. Give access to the users for all reports.
    2. Give No Access to Retail Folder
    3. GIve read or full access to dashboard folder.
    To set the permission , click on the object/folder bottom left you will find Permission. you set there.
    Mark if correct,
    fiaz

  • How to Upload the Materials for one Plant and then copy the same to all oth

    Hi All,
       I am using Material Types NonStock, Service, Spare Parts and Trading.
       How to Upload the Materials for one Plant and then copy the same to all other plants.
    can anybody give response for this requirement.
    Regards...
    <b></b>

    Hi,
    Using MM01 Only we can upload Plant Details.
    If you want to extend to other plant also, Use MM01 and select Plant view and give new plant details.
    If you want to copy from one plant to another plant after selecting Plant view , next screen you can select From Plant and To Plant Details.
    Reward Points If it helps you.
    Regards,
    Murali K

  • How to use the API for DATE, MONTH  AND YEAR

    I would like to use the java api in .util.calender in the java api to get the date.
    How to implement the API for the "DATE","MONTH","YEAR" which are available provide by java?
    can someone give me in one complete code?

    From the Java Developers Almanac 1.4:
        Calendar cal = new GregorianCalendar();
        // Get the components of the date
        int era = cal.get(Calendar.ERA);               // 0=BC, 1=AD
        int year = cal.get(Calendar.YEAR);             // 2002
        int month = cal.get(Calendar.MONTH);           // 0=Jan, 1=Feb, ...
        int day = cal.get(Calendar.DAY_OF_MONTH);      // 1...
        int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 1=Sunday, 2=Monday, ...

  • How to unlock the request for a report and add the same query to new reques

    hi,
         how to unlock the request for a  and add the same query to new reques

    You can unlock in SE03 tcode.
    Goto tcode SE01, give the transport number --> display --> double click on the transport --> in the next screen select all the elements --> delete --> save.
    To attach it to another transport, In RSA1, click on transport connection> Choose Object types> query elements --> here you can find your query/ or you can search, which you can drag to right and attach to the transport (using truck button).

  • How to extend the timeout for long running queries

    I unfortunately have a query that needs to run for 2 hours (long story) to load a year's worth of data into PowerPivot (RTM).  PowerPivot stops with an error after running for 1 hour.  I tried changing the "General Timeout" setting from 0 to 28800
    (8 hours) in the SQL conneciton settings (native client 10.0) and I also managed to get the server owner to increase the "Query Timeout" setting in the SQL Server's Connections dialog but PowerPivot still errors out after 1 hr.  
    A workaround will be to use SSIS to run the query and store the result in another database but I'd rather not do that if I don't have to.
    Error Message
    The refresh operation failed because the source data base or the table does not exist, or because you do not have access to the source
    More Details:
    OLE DB or ODBC error: Query timeout expired; HYT00.
    An error occurred while processing the 'XXXX' table.
    The operation has been cancelled.
    Is there any other place where the timeout can be set or controlled that I've missed?

    Try 
    1) Setting "ExternalCommandTimeout" in the server configuration file (msmdsrv.ini) to a multiple of seconds you want (in this case >7200, by default it is 3600(1hr)).
    2) Restart the server.
    3) Refresh the data.
    Please let me know, if this doesn't work.

  • How to control the depreciation for revaluation from next month ?

    Dear all,
    I post current year ord. depreciation revaluation via trx. ABAW (Bal. Sheet Revaluation), and the general ledger will be updated after depreciation run.
    In our client, the scenario is  AFAB (dep run) --> ABAW (revaluation) --> AFAB (dep repeat run).
    Now my problem is I want the revaluation value be depreciated next month and the second AFAB just for general ledger posting.   I have set the period control '11'(next month) for revaluation but  it doesn't work, the second AFAB still generates both G/L and depreciation posting.
    How can I control the revaluation depreciation from next month?
    Thanks for your help.

    Hi,
    we have used a different approach. We run two separate depreciation areas:
    01 - ordinary depreciation
    03 - revaluation
    We maintain two complete streams of data. 01 is linked to the original acquisition value of the asset and depreciates normally.
    03 is linked to the revaluation. Each month we recalculate the replacement value, revalue the accumulated depreciation and then run depreciation using transaction AFAB.
    I don't think it will work in the way you described.
    Kind regards,
    Rudolf

  • How to write the query for year revenue and avg

    Hello Team
    I have the table
    create table sale (sale_id varchar2(32) not null, sale_epoch_microsec numeric(18,0)
          not null, sale_amount_cents numeric(18,0) not null, customer_id varchar2(32)
          not null, industry_id varchar2(32) not null, product_id varchar2(32) not null)The industry the customer is considered to be in can change from sale to sale. sale_epoch_microsec is microseconds since epoch; sale_amount_cents is the value of the sale in pennies.
    The data in this is:
    Insert into SALE
       (SALE_ID, SALE_EPOCH_MICROSEC, SALE_AMOUNT_CENTS, CUSTOMER_ID, INDUSTRY_ID,
        PRODUCT_ID)
    Values
       ('s1', 200000000, 69985484589459, 'c1', 'i1',
        'p1');
    Insert into SALE
       (SALE_ID, SALE_EPOCH_MICROSEC, SALE_AMOUNT_CENTS, CUSTOMER_ID, INDUSTRY_ID,
        PRODUCT_ID)
    Values
       ('s2', 200000000, 69985484589459, 'c2', 'i2',
        'p2');
    Insert into SALE
       (SALE_ID, SALE_EPOCH_MICROSEC, SALE_AMOUNT_CENTS, CUSTOMER_ID, INDUSTRY_ID,
        PRODUCT_ID)
    Values
       ('s3', 6579000000, 6.99675342390895E16, 'c3', 'i3',
        'p3');
    Insert into SALE
       (SALE_ID, SALE_EPOCH_MICROSEC, SALE_AMOUNT_CENTS, CUSTOMER_ID, INDUSTRY_ID,
        PRODUCT_ID)
    Values
       ('s4', 6.5866459684979E17, 6.99675343454391E17, 'c4', 'i4',
        'p4');
          1.) SQL: Write the SQL query to determine, year-over-year, the total revenue and avg. per-product revenue from customers in the 'Gaming' industry.

    josh1612 wrote:
    As in the question it's mentioned that the date is in microseconds,
    So i need the guidence to convert that to the date .Convert microseconds to seconds and then you may be able to use the function below which was found here:
    http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_dates.html
    CREATE OR REPLACE
        FUNCTION unixts_to_date(unixts IN PLS_INTEGER) RETURN DATE IS
             * Converts a UNIX timestamp into an Oracle DATE
            unix_epoch DATE := TO_DATE('19700101000000','YYYYMMDDHH24MISS');
            max_ts PLS_INTEGER := 2145916799; -- 2938-12-31 23:59:59
            min_ts PLS_INTEGER := -2114380800; -- 1903-01-01 00:00:00
            oracle_date DATE;
            BEGIN
                IF unixts > max_ts THEN
                    RAISE_APPLICATION_ERROR(
                        -20901,
                        'UNIX timestamp too large for 32 bit limit'
                ELSIF unixts < min_ts THEN
                    RAISE_APPLICATION_ERROR(
                        -20901,
                        'UNIX timestamp too small for 32 bit limit' );
                ELSE
                    oracle_date := unix_epoch + NUMTODSINTERVAL(unixts, 'SECOND');
                END IF;
                RETURN (oracle_date);
        END;

  • How to control the printer selection popup in SAP SCRIPT .

    Hi all,
    I have written a print program which is calling 5 different layouts forms and printing all the shipping related documents such as packing list, delivery note, shipping label etc . The print program is
    attached to a single output type ZEDM. 
    The issue is that for printing every document a pop-up comes for the printer selection and i want
    only one pop-up and all the document should be printed.
    Can anyone tell how to control the pop-ups.
    Thanks and Regards,
    Syed

    Hi,
    Open the form with dialog once. and then other forms pass ' ' to dialog parameter in OPEN_FORM .
    Open the form for printing
      Capture the return code
      Capture messages
    Other froms
    Open the form for printing
      Capture the return code
      Capture messages
    Whenever you have a new form use START_FORM
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          device                      = 'PRINTER'
          dialog                      = 'X'
          form                        = p_fname
          language                    = sy-langu
          OPTIONS                     = p_itcpo
        EXCEPTIONS
          canceled                    = 1
          device                      = 2
          form                        = 3
          OPTIONS                     = 4
          unclosed                    = 5
          mail_options                = 6
          archive_error               = 7
          invalid_fax_number          = 8
          more_params_needed_in_batch = 9
          spool_error                 = 10
          codepage                    = 11
          OTHERS                      = 12.
      IF sy-subrc <> 0.
        w_retcode = 1.
        PERFORM protocol_update.
      ENDIF.
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          device                      = 'PRINTER'
          dialog                      = ' '
          form                        = p_fname
          language                    = sy-langu
          OPTIONS                     = p_itcpo
        EXCEPTIONS
          canceled                    = 1
          device                      = 2
          form                        = 3
          OPTIONS                     = 4
          unclosed                    = 5
          mail_options                = 6
          archive_error               = 7
          invalid_fax_number          = 8
          more_params_needed_in_batch = 9
          spool_error                 = 10
          codepage                    = 11
          OTHERS                      = 12.
      IF sy-subrc <> 0.
        w_retcode = 1.
        PERFORM protocol_update.
      ENDIF.
    CALL FUNCTION 'START_FORM'
        EXPORTING
          form      = w_fname
          language  = sy-langu
          startpage = 'PAGE'
          program   = sy-repid.
    Regards
    Krishna

  • How to control the bandwidth of my router WRT54G3G

    hi all
    plz i need to know how to control the bandwidth for all pc connect through the router ?
    thank you

    Logon to router’s setup page, click on “Applications & Gaming”, click on QoS…you can manage bandwidth using a QoS feature.

  • How to create  the BOM for co product

    Dear friends,
    How to create the BOM for Co product  and How the production will create and  how the costing will capture for that.
    Regards,
    Sabhapathy R

    Dear Umesh,
    How Bom created for co product
    By product
    Header
    xxx
    101
    mvt
    mvt
    qty
    item
    yyy
    261
    1
    zzz
    531
    0.5-
    By product
    Same way how we create co product for BOM. pl explain with simple example.
    Thanks &regards,
    Sabhapathy R

  • How to priorities(QoS) the traffic for DSCP 46 and 34 in cisco 2960s switch

    HI,
    We are going to implement Microsoft Lyncs 2013 in our network, so how to priorities the traffic for DSCP 46 and 34 in cisco 2960s switch. Kindly replay with detailed QoS commands for enabling QOs in LAN.
    Thanks
    Sujish

    Hi,
    Have a look at this config guide for all the details:
    http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst2960/software/release/12-2_53_se/configuration/guide/2960scg/swqos.html
    HTH

  • How to control the looping time of the for loop in 10 microseconds in labview?

    I need to create a +/- 9 volt square wave with period of 20us using a D/A card (Not NI card). I can write command to the card using outport provide by Labview. Right now, I can generate square wave with 4ms period which is limited by the resolution of the wait until next ms icon I used inside the for loop. Could anyone tell me how to control the execution time of the for loop to about 10 us? Your help would be much appreciated.

    I'm not sure if this will hep, but this answer seems to answer this question
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000800000029410000&UCATEGORY_0=_30_%24_12_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=microsecond+resolution+1ms&USEARCHCONTEXT_QUESTION_S=0

  • Toolkit for CreateJS: How to control the main timeline from outside the canvas.

    Hey Everyone,
    I'm currently trying to do something simple, but my animation breaks whenever I attempt to change my code. I have created a basic animation in Flash where an object moves from the left side of the canvas, to the right, and then loops from the last frame to the first frame. Nothing else. The animation is simply put on the main timeline. I exported the animation with Toolkit for CreateJS through Flash's extension and the animation runs as it should. I am trying to start and stop (restarting from the first frame) the animation with mouse over and mouse off events. I want the events to fire when moused over/off a div OUTSIDE the animation's canvas tag. Is this possible with CreateJS? I'm trying to figure out how to control the main timeline without being inside the canvas tag.
    Example HTML:
    http://www.thephotoncore.com/testing/example_test.html
    Example Code:
    <section id="container">
      <canvas id="canvas" width="550" height="400" style="background-color:#cccccc"></canvas>
      <section id="animation_control">
        <p>Roll over to start and stop animation.</p>
      </section>
    </section>
    Thanks again for the help!
    -DJ

    Hi DjPhantasy5,
    All movieclips on the stage are children of the stage,
    So on the "mouseover" all movieclips on the stage could be stopped with stop and on the "mouseout" all children could be restarted with gotoAndPlay like this:
    function Stop()
              if (stage && stage.children)
                        var i, l = stage.children.length;
                        for (i = 0; i < l; i++)
                                  var child = stage.children[i];
                                  if ("stop" in child)
                                            child.stop();
    function Restart()
              if (stage && stage.children)
                        var i, l = stage.children.length;
                        for (i = 0; i < l; i++)
                                  var child = stage.children[i];
                                  if ("gotoAndPlay" in child)
                                            child.gotoAndPlay(0);
    See http://www.liauw.nl/forums/adobe/djfantasy5/index.html
    But it is also possible to expose "ball1", for example, by adding it to the document.
    This can be done by adding code to "ball1" like so:
    /* js
    document.ball1 = this;
    Then the stopping of the animation would look like:
    function Stop()
         if ("ball1" in document)
              document.ball1.stop();
    etc.
    Have fun!
    Ronald

  • How to control socket timeout

    I have an application that connects to a ftp server. After some time that the user doesn�t do anything, I get a timeout message. I set socket.setSoTimeout(0) but I still get the message. I keep the connection to the ftp server open all the time.
    It should be better to open and close every time ? the user needs to access a lot of times to the ftp server, but maybe he can stay some time without having to access it (here is when I got the message "No Transfer Timeout (300 seconds): closing control connection").
    How can I control, before sending a command to the ftp server, if it happens this to do another connection ?
    Thanks !

    hehe, i've had the same problem many times, let the ftp client alone for a while, and then you got to write your name and password again...
    i guess the server wont let you change its properties. don't know the tcp commands that could get it.
    and about doing something every minute, well, it works for you, but the timeout has ist causes, and it is not nice to use the server and the net resources fon nothing.
    my advice, just make the user interface of your client nice, and if if gets disconnected because timeout, just wait till the user wanna do somethingm and then connect again without asking for his/her password and login, nor ftp address...
    so the user wont be annoyed, nor the server.

Maybe you are looking for

  • IPod Nano no longer updates

    Every time I try to update my Nano, it says that the software to communicate with the iPod is installed incorrectly. I've tried installing the software so many different times that I can't even begin to count the attpempts and still, it doesn't updat

  • Iweb pages all jumbled

    After a period of NOT updating website........open to find text on one website all jumbled up.  Website appears OK online........but not sure what to do and/or how to change. Have a couple other websites that appear OK Any ideas?

  • Camera Fusion .. is it possible on Labview ?

    I am trying to take the simultaneous feed of two fire wire cameras and fuse them together. For example i want to cut half the frame of one camera and half the frame of the other camera and then fuse them together in such a way that if both the camera

  • Can someone help me with "no format has been reg. for RTP Payload type 10"

    I am trying to send audio from Mac to PC. Mac uses quicktime for java and PC uses jmf. I looked at the Jmf supported formats list and on the SDP file for mac i used payload types like : m=audio 2656 RTP/AVP 0 c=IN IP4 239.60.60.60 . I also tried othe

  • Adobe Application Manager Enterprise Edition...

    The update server is not responding. I'm attempting to build a deployment package for Captivate. I get this error after the Updates screen. We are behind a proxy. I suspect that is the issue. Is there a way to manually enter the proxy information via