How to make the recv function in winsock2 stop after a specific time..?

In an developing a Windows Desktop Console Application in c++ in Visual Studio 3013 for Windows Desktop, which acts as a client and tries to connect to a server. Once the Connection with the server is successful, it sends a handshaking signal to the
server and waits for a response from the server. Iam using winsocks2 in this application. The receive function I am using is a blocking call
iResult = recv(ConnectSocket, recvbuf, recvbuflen, 0);
So until my server sends a response, the client is blocked. What I need is the client to check for response only for a certain time (say 10 sec). If there is no response within this time frame ,I want the client to disconnect from the server. How to achieve
this?

In an developing a Windows Desktop Console Application in c++ in Visual Studio 3013 for Windows Desktop, which acts as a client and tries to connect to a server. Once the Connection with the server is successful, it sends a handshaking signal to the
server and waits for a response from the server. Iam using winsocks2 in this application. The receive function I am using is a blocking call
iResult = recv(ConnectSocket, recvbuf, recvbuflen, 0);
So until my server sends a response, the client is blocked. What I need is the client to check for response only for a certain time (say 10 sec). If there is no response within this time frame ,I want the client to disconnect from the server. How to achieve
this?
You could use setsockopt
https://msdn.microsoft.com/en-us/library/windows/desktop/ms740476%28v=vs.85%29.aspx
to set the timeout option, SO_RCVTIMEO, for the recv
function.

Similar Messages

  • How to make the wdDoIniiit() function executived twice in the view of WebDy

    Hi Guyes, How can i make the  wdDoIniiit() function executived twice in the view of WebDynpro? Thank you

    Hi
    WdDoInit() :- This is called only once when the View is loaded freshly.
    WdDoModifyView:- Called every time an action is performed on the View.
    It is called by webdynnpro runtime environment for modification of the view layout.
    For all the views,this takes place at a time immediately before the closing response renders.
    check for
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/86/16e13d82fcfb34e10000000a114084/frameset.htm">Modifyview</a>
    also you can know about <a href="http://help.sap.com/saphelp_nw04/helpdata/en/86/7fcf3d4f902d10e10000000a114084/frameset.htm">Supply function</a>
    Regards
    Abhijith YS

  • How to make the scrollbar function with mouse scroll wheel?

    Is there a way how to make my content scroll even with the mouse scroll wheel?... I have to edit the coding??

    Hey!
    You shouldn't have to edit any code.
    There is an active player bug surrounding this issue however, which causes the following:
    1) It should work on windows.
    2) It may not work on Mac.
    We're continuing to pursue this issue, we know it's important to our users.
    Thanks,
    Tara

  • How can make the latest Adobe Presenter trial stop causing Powerpoint crash?

    I have downloaded the latest trial of Adobe Presenter, in the "About Presenter" feature it shows it to be Version 7.0.7
    I am using Powerpoint 2007 on a Windows XP laptop.
    The trial downloaded well, it records voice well, it syncs well with animation, and it appears ok on the PowerPoint Add in bar. I managed to create some 2-3 test recordings on a PowerPoint presentation I already have, that needs turning into a Presentation. That was all. Since then Powerpoint hasn't stopped crashing. Getting back to it functions well, the problem appears whenever I finish recording. Regardless of whether I press the stop or pause button. Earlier on it happened when then pressing ok, and only after "stop" button. Now it does it every single time, and of course, it's crashing before it can save any audio files.(I haven't even tried publishing, simply because I have nothing to publish because of these crashes!)
    I have browsed solutions online but they all seemed dated: like I said this is the latest version (what it seems 7.0.7) and even if I tried to download patches it doesn't accept them. Looking for updates from the add-in bar from Powerpoint only results in "no updates available for this version".
    Please help! This seems to be exactly what I was looking for but obviously not if it doesn't work!
    Thanks,
    Gabriel

    Hi Shubhi,
    I'm sorry I can't do that. I don't have 7.0.7 anymore, it would be stupid to keep a piece of software that it's not working. I can't have both versions at the same time and I need to do my work, so working fine with 7.0.6.
    Besides, I have already provided all the steps I followed, and the problem was indeed the same for new or old presentations, working from a Windows XP laptop and PowerPoint 2007 (with presentations saved in either 2003 or 2007 powerpoint versions).
    I hope I could help in any way, but I can't spend more of my work/own time in uninstalling/installing versions, or for free!
    Regards,
    Gabriel

  • How do you make the 'places' function work in iphoto

    `i have just imported a lot of old photos from my 2007 macbook onto a new macbook pro with ilife 09. `i am trying to make the places function work but can't get it to work. The 'i' icon does not appear in the bottom right hand corner of the events main photo as it's supposed too. Any suggestions?

    Simply open an event; select 1 or more photos and select the i in the lower right corner of a photo thumbnail. You will get the Geocoding window. Start typing the address/place/country in the location area. For detailed addresses you select new place. You can resize the window. Maps from google appears and you select the place it finds. You can even drag the pin to a specific area. Press ok and your done.

  • How to make the status of a sales order complete of which PART DELIVERY

    How to make the status of a sales order complete of which PARTIAL DELIVERY has already done. <b>(Assigning rejection status not accepted)</b>

    Hi Gyana
    There is no document with me. But I can confidently say that because I am using this functionality.
    In my case I have created a Order Reason as "Short Closed". once you short close this order only the balance quantity gets rejected (provided you have already made previous delivery and PGI).
    Try it in one of your test clients if you have. Once it is short Closed it wont also show in the orders due for processing in Production.
    Also you can generate reports based on this if your customer wants to know how many order he has short closed, qty of item short closed etc.
    Try it.
    Rgds
    Sunil

  • How to make the buttons INVISIBLE in the Application toolbar

    Hi All,
    I have a requirement to create a button in the Application toolbar of the Module Pool Screen. The field should be made Invisible by default. and it should be displayed based on one condition.
    Could you please let me know how to make that particular button INVISIBLE. I think we can make it invisible by using EXCLUDING statement. But, How to make the button VISIBLE again when the check is satisfied.
    I found from the portal that the FM 'VIEW_SET_PF_STATUS' can be used to make a button INVISIBLE. Could anyone help me out how to pass the parameters to this Function module?
    or is there any Function Module available to make the button VISIBLE and INVISIBLE? Please help me on this issues.
    Is there any possibility to make the button VISIBLE or INVISIBLE as we do for the screen fields using LOOP AT SCREEN..?
    Thank you in advance.
    Regards.
    Paddu.

    Hi,
    Try to use below in the PBO module status_0100 OUTPUT.
    DATA t_fcode TYPE TABLE OF sy-ucomm.
    refresh t_fcode[].
    APPEND 'Function code name of the button' TO t_fcode. 
    Check the condition here for which you want to make field visible.
        DELETE FCODE of the button from T_FCODE table
      ENDIF.
      SET PF-STATUS 'STATUS_0100' EXCLUDING t_fcode.

  • How to make the exchange of data between 2 while loop in real time

    hello
    I have 2 while loop
    the 1st while loop includes the data acquisition program
    the 2nd while loop includes the control program
    my question is how to make the exchange of data between 2 while loop in real time
    I tried with the local variable and direct wiring between the 2 while loop
    it does not work (there is a delay)
    Solved!
    Go to Solution.

    Bilalus,
    Queues are only good to transfer data if your application isn't deterministic. Since you are using Real Time, I am assuming that your application requires determinism. If you are using Timed Loops and you use queues to transfer data between your loops, you are losing determinism. In this case, you need to use the RT FIFO functions. 
    Warm Regards,
    William Fernandez
    Applications Engineering
    National Instruments

  • How to make the words of the menu bar on the top of the screen look bigger?

    I am considering changing my 15.4'' to 17'', so I went to Apple store and took a look at the 17'' MBP, this machine is awesome and the display is set at 1900 X 1200, I realized that the words are smaller every where. While I know how to adjust the words below the icons to make it bigger, but I really don't know how to make the words bigger in the menu bar, in the menu bar of safari, menu bar every where, does anyone here know how to do it?

    Yes, but it isn't here yet.
    Sometime next year, Apple is supposed to enable the resolution independent version of the UI which will mean you can get easily readable stuff even with the much higher resolution monitors that are coming.
    For now you have only two good choices: Use a lower resolution on the monitor or use the Zoom function of Universal Access (and pan the image around on the screen) to help with visibility.
    --Bob

  • How to make the session to wait until other session get closed successfully

    Hi ,
    In my program , I am calling sql loader and after that I am opening a session and inside that I am calling stored procedure which validates the data.
    above calling of sql loader and stored procedure is done inside the shell script i.e .prog file which is registerd as host concurrent program.
    Here i am facing the problem like when two files are processed with same content then second file content's are not erroring out as duplicate though there is a duplicate validation exist inside the procedure. IF I call dbms_lock.sleep(60) then it is working and sencond file are records are error out with duplicate error message. but this is working only for small data files.
    Please suggest me how to make the session to come out successfully then only i can open other sesssion .
    Thanks
    Raghav

    user5853450 wrote:
    Hi ,
    In my program , I am calling sql loader and after that I am opening a session and inside that I am calling stored procedure which validates the data.
    above calling of sql loader and stored procedure is done inside the shell script i.e .prog file which is registerd as host concurrent program.
    Here i am facing the problem like when two files are processed with same content then second file content's are not erroring out as duplicate though there is a duplicate validation exist inside the procedure. IF I call dbms_lock.sleep(60) then it is working and sencond file are records are error out with duplicate error message. but this is working only for small data files.
    Please suggest me how to make the session to come out successfully then only i can open other sesssion .
    Thanks
    RaghavFor starters you could use external tables rather than SQL*Loader and then you could keep all the control on the database side of things rather than relying on an external utility. The external tables will give you all the functionality of SQL*Loader but all you to just read the data using SQL select statements instead and cut out all the shell script dependency.
    Alternatively you could also look at Job Chaining...
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14214/chapter1.htm#FEATURENO05574

  • Compatibility of use between IE8 & FF4 bookmarks functions. I need to make the bookmark functions behave exactly as they do in IE8.

    I would like to install FF4 on my wife's computer but she's not big on change. How can I make all the imported IE bookmarks appear as they do when you click on IE Favorites without having to go to sub-menus? Moreover when you add a new bookmark scrounging around to find the location to save the new bookmark is also a non-starter.
    I know I could probably use the sidebar function but that just takes up screen real estate.
    I am posting this from my laptop so the info about the installed plug-ins does not pertain to my wife's computer.

    Thank you for trying the new Firefox. I'm sorry that you’re unhappy with the new design.
    I understand your frustration and surprise at the removal of these features but I can't undo these changes. I'm just a support volunteer and I do not work for Mozilla. But you can send any feedback about these changes to http://input.mozilla.org/feedback. Firefox developers collect data submitted through there then present it at the weekly Firefox meeting
    I recommend you try to adjust to 29 and see if you can't make it work for you before you downgrade to a less secure and soon outdated version of Firefox.
    Here are a few suggestions for restoring the old design. I hope you’ll find one that works for you:
    *Use the [https://addons.mozilla.org/en-US/firefox/addon/classicthemerestorer/ Classic Theme Restorer] to bring back the old design. Learn more here: [[How to make the new Firefox look like the old Firefox]]
    *Use the [https://addons.mozilla.org/en-US/firefox/addon/the-addon-bar/ Add-on Bar Restored] to bring back the add-on bar. Learn more here: [[What happened to the Add-on Bar?]]

  • Why can't Apple and HP get Mountain Lion 10.8.4 to work with the HP OfficeJet 7610?  Does anyone know how to make the wireless scanning work?

    Does anyone know how to make the HP OfficeJet 7610 (latest version) and iMac 3.4 GHz i7 running 10.8.4 work together correctly?  Print function seems to work ok.  Just can't find the scanner in any setup.

    In System Preferences/Print & Scan is there a scan option?

  • I cannot figure out how to make the text larger on an incoming email.  The finger method doesn't work and I cannot find any toolbar with which to do it.  I could find nothing in settings also.  Plese help and thank you.

    I cannot figure out how to make the text larger in a received email.  The finger method doesn't work and I can find no tool bar as I can for composing emails.  I can find nothing in settings.  Please help and thank you in advance.

    Hi there,
    Download a piece of software called TinkerTool - that might just solve your problem. I have used it myself to change the system fonts on my iMac. It is software and not an app.
    Good wishes,
    John.

  • In firefox 4 RC, some addons installed suddenly disappear, but checking the profile, some of the missing addons related files are still here, how to make the addons back?

    I use firefox 4 form beta 9 to RC (zh) now and there are also firefox 3.6 installed in computer. One day when I open Fx 4 RC, some (actually a lot but not all) of the adoons just disappear. When I check on about:addons page, some addons installed do not appear in the list.
    The addons '''REMAINED''' including:
    * addons I already used in Fx 3.6 (like webmail notifie , xmarks)
    * ''addons only can use in Fx 4'' (like Open Web Apps for Firefox).
    The addons '''DISAPPEARED''' including:
    * addons I already used in Fx 3.6 (like yoono)
    * '' addons installed when using Fx 4'' (like updatescanner, Thumbnail Zoom).
    But when I check the profile(by Help > Troubleshooting Information>Open Containing Folder) , some (not sure is it all) of the missing addons related files are still here [lucky], so any one know how to make the missing addons back?
    Some more details:
    * This happened when i use RC for already a few days and keep on even i restart Fx and windows.
    * The bookmarks, history, search engine and even themes and icon setting are still here. [ I only sync bookmarks but not history for both xmarks and firefox sync.]
    * This addons are really '''disappeared''' but not disable only!
    * This number of addons missed, as i remember, at least 30, should be more than that number bacause some of them are installed but in disable mode.
    * I try to install back one of the addons - Stylish, the installed code are still here.
    * It is nearly an impossible mission to install every missing addons again, as it really kill my time.

    Delete the files extensions.* (extensions.rdf, extensions.cache, extensions.ini, extensions.sqlite) and compatibility.ini in the Firefox [[Profiles|profile folder]] to reset the extensions registry. New files will be created when required.
    See "Corrupt extension files": http://kb.mozillazine.org/Unable_to_install_themes_or_extensions
    If you see disabled, not compatible, extensions in "Tools > Add-ons > Extensions" then click the Tools button at the left side of the Search Bar to do a compatibility check.

  • How to remove the sort function on the drill down and then save

    how to remove the sort function on the drill down and then save in the  change local view of the Query
    Is it possible to change the porperties of any characteristic in the local view and then save?
    If so please post the answer.

    I do not think that option is possible.
    Regards,
    Venkata Boga.

Maybe you are looking for

  • Using a filechooser in an applet

    Is it possible to use a filechooser for an applet save button? If so how can you do it? So far I have only been able to use the filechooser object with JFrame and not JApplet.

  • IChat no longer connects

    I have used iChat many times early in the year with no problems. I have not used iChat over the past several months. Recently I started using it again and I am having problems connecting. I am constantly getting error codes -7 & -8 Recently my son go

  • Logical identifiant for User Notes synchronized from LDAP

    After a synchronization from LDAP to Notes, The user entry is created, all attributes are OK The certificate is created and named with %uid%.id BUT the logical name of the user in the Notes database is constructed as "%givenname%SPACEd/DOMAIN". I don

  • Web Application working correctly only with Everyone user added to user privilages

    Hello, I have an web application in Sharepoint 2013 which only works correctly with the Everyone (Read Only) user added to User Privileges in Central Admin.  If I remove Everyone user from user privileges, user domains, that are added to access group

  • Adobe Pdf Scripting

    Hello All, Here i need solution to a specific scenario in Adobe Pdf forms In a Adobe Form, whenever we have a Dynamic Text or Numeric field, which can be either binded or scripted to fetch data from a Data Source, it works fine. But in some case for