SOL_SOCKET Socket Options?

Hello everyone

I use the following code to set send timeout and receive timeout for HTTP request
but the timeout is about 60 seconds in Windows 98, not 15 seconds which I expect 

My question is
Do Socket Options SO_SNDTIMEO and SO_RCVTIMEO not work in Windows 98

+++++++++++++++++++++++++++++++++
#include "winsock2.h
.
.

m_nSendTimeout=5000
m_nRecvTimeout=10000
.
.

//set recieve timeou
if(setsockopt(sckHTTPSocke
      ,SOL_SOCKE
      ,SO_RCVTIME
      ,(const char *)&m_nRecvTimeou
      ,sizeof(m_nRecvTimeout))!=0

      closesocket(sckHTTPSocket)
      return


//set send timeou
if(setsockopt(sckHTTPSocke
      ,SOL_SOCKE
      ,SO_SNDTIME
      ,(const char *)&m_nSendTimeou
      ,sizeof(m_nSendTimeout))!=0

      closesocket(sckHTTPSocket)
      return


+++++++++++++++++++++++++++++++++

Thank you

Delu Qiu
0
anonymous (74717)
5/11/2004 3:21:01 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
941 Views

Similar Articles

[PageSpeed] 40

Sounds like you are trying to use synchronous sockets. Ditch this approach and go with
asynchronous sockets, and these parameters probably don't matter.
					joe

On Tue, 11 May 2004 08:21:01 -0700, "delu" <anonymous@discussions.microsoft.com> wrote:

>Hello everyone,
>
>I use the following code to set send timeout and receive timeout for HTTP request,
>but the timeout is about 60 seconds in Windows 98, not 15 seconds which I expect .
>
>My question is:
>Do Socket Options SO_SNDTIMEO and SO_RCVTIMEO not work in Windows 98?
>
>++++++++++++++++++++++++++++++++++
>#include "winsock2.h"
>.
>.
>
>m_nSendTimeout=5000;
>m_nRecvTimeout=10000;
>.
>.
>
>//set recieve timeout
>if(setsockopt(sckHTTPSocket
>      ,SOL_SOCKET
>      ,SO_RCVTIMEO
>      ,(const char *)&m_nRecvTimeout
>      ,sizeof(m_nRecvTimeout))!=0)
>{
>      closesocket(sckHTTPSocket);
>      return;
>}
>
>//set send timeout
>if(setsockopt(sckHTTPSocket
>      ,SOL_SOCKET
>      ,SO_SNDTIMEO
>      ,(const char *)&m_nSendTimeout
>      ,sizeof(m_nSendTimeout))!=0)
>{
>      closesocket(sckHTTPSocket);
>      return;
>}
>
>++++++++++++++++++++++++++++++++++
>
>
>Thank you,
>
>
>Delu Qiu

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
5/11/2004 11:06:08 PM
Reply:

Similar Artilces:

UIThread and Socket ?!? (socket works fine but....)
hello i have written an littel application with a UIThread. In this thread i create a Socket, to receive any msg If the CAsyncSocket::OnReceive() fired, i read IN THE SOCKET-CLASS the incomming Data. After thi i call the Thread with PostThreadMessage() to process the Data When the Thread is working and a NEW data-msg is comming up, the Socket read it exactly !!. But the PostThreadMessage() call in my SockteClass is without reason. Also the Thread don´t get the Message ! How can i solve the problem thx in advanc p3p I'm not sure what you mean by the questions. What do you mean ...

Strange Problem with Chart and Plot Visible Cells Option
I'm deslecting the "Plot visible cells only" option on some charts in order to display a chart while hiding the data. It works well except for one case. On one chart when I deselect this option, Excel adds some additional series' to my chart and also changes the range of my X axis labels. Does anyone have a clue about this? I'm totally stumped. Note that on all my charts I've using the Offset and CountA functions to create dynamic charts that automatically update the chart when new data is added. Thanks very much. Marcus Marcus - If your series are in columns...

Socket Error WSAEPROVIDERFAILEDINIT
Hola a todo el mundo.... Mi problema es al crear un socket sobre w2k3, el valor de retorno es WSAEPROVIDERFAILEDINIT. El entorno en el que trabajo es el siguiente: Tengo un LSP registrado en la lista de catalogos de windows, los eventos que manejo son: lpProcTable->lpWSPConnect =3D WSPConnect; lpProcTable->lpWSPAccept =3D WSPAccept; Adem=E1s tengo un servicio que abre un puerto (0x0B50), pero al momento de crear el socket, este retorna WSAEPROVIDERFAILEDINIT, un fragmento del c=F3digo es. ..=2E ..=2E. wVersionRequested =3D MAKEWORD(2, 0); err =3D WSAStartup(wVersionRequested, &am...

Sorting Option missing
Does anyone know how to add a sort option for one of the standard grid in CRM 3.0? We want to add sort for the the Relationship grid available from an Account entiity form (under details navigation). I beleive this is a default grid and we have not customized any views either. Sorting for this is also not available in MS VPC for CRM 3.0. Thanks. ...

Quick campaign wizard: add option 'Directly send e-mails'
In de Quick Campaign wizard, you should be able to choose whether or not you would like the generated e-mail (or letters, faxes, etc) to be send directly upon creating the quick campaign. Perhaps this option should only be available is the user choose to be the owner of the generated activities (the first step in the wizard). Currently in Dyanmics CRM, the administrator must modify the Windows registry to activate this feature, and then the settings applies to all quick campaigns. This current solution is very inflexible. I hope this is a usefull suggestion ! :-) Regards, Kasper van ...

security option in OE
In Outlook Express the Option to "Do not allow attachments to be saved or opned" in Tools/Options/Security is checked but grayed out. I am wanitng to uncheck but cannot find out how. "dougs" <anonymous@discussions.microsoft.com> wrote in message news:13c2d01c44408$b671b970$a101280a@phx.gbl... > In Outlook Express the Option to "Do not allow > attachments to be saved or opned" in > Tools/Options/Security is checked but grayed out. I am > wanitng to uncheck but cannot find out how. This newsgroup is for support of Outlook 97/98/2000/2002/200...

Publisher should have option to scale large poster to fit page
I make large scientific posters using Publisher. I used to do it using PowerPoint, but Publisher is much better for the task. However, PowerPoint has the option of scaling my 3 ft x 4 ft posters to one 8 1/2 x 11 page, so I can print a miniature version. Publisher should include this option! It's really valuable for making minatures, or draft copies before printing huge, expensive posters. ...

Where are automated balance options in 2004?
I just installed MS Money 2004. I have 3 checking accounts. I clicked on Perform Automated Balance for the first account and was asked two questions (can't remember exactly what they were-something like Do you want to Automatically Balance when you login?) Anyway, it autobalanced the first account, but when I tried to autobalance the other two accounts, nothing happens. I click on Perform Automated Balance and nothing happens. Where are the options for this procedure for each account? Sharon .. ...

How would I set up print options for a school yearbook?
I am having a heck of time trying to print our elementary school's yearbook. I have thirty pages and want to print it so that it staples in the middle and reads like a regular book. Sometimes I get 8 pages printed on one sheet of paper (4 on front and 4 on back) sometimes I get just one page on each side. I am on a deadline and am running out of time, HELP! krazimom <krazimom@discussions.microsoft.com> was very recently heard to utter: > I am having a heck of time trying to print our elementary school's > yearbook. I have thirty pages and want to print it so that it st...

Add "Accept & Open" option for queues
When working with Queues, there is a need for an "Accept & Open" option that moves the item to your in progress queue then immediately opens the item so you can work on it. The current workflow requires multile clicks and is cumbersome. -- Matt Parks MVP - Microsoft CRM ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-base...

Tracking Options on Moneycentral
I am trying to track Option Trades on Moneycentral 'Portfolio' and see that it is not supported feature at this time. Can anyone tell me when this will be a supported feature? You can put options on your watchlist, get quotes etc, just not add to your portfolio. In microsoft.public.money, shaned123 wrote: >I am trying to track Option Trades on Moneycentral 'Portfolio' and see that >it is not supported feature at this time. > >Can anyone tell me when this will be a supported feature? > >You can put options on your watchlist, get quo...

Problem with socket
hi i am using SOCKET data type for socket connecttion i am binding the socket on any port available betwneen 3312 -4000 and start listening successfully but on the accept() command my program get crashed. the code is given below: here m_pSocket and msgsock both are SOCKET type UINT Bthread(LPVOID p) { CBufferSocket *dlg=static_cast<CBufferSocket *>(p); TRY { int iPort; BOOL bPort=FALSE; // selecting the port for(iPort=3312;iPort<4000;iPort++) { dlg->serv.sin_addr.s_addr=htonl(INADDR_ANY); dlg->serv.sin_family=AF_INET; // standard connect dlg-...

How to revalue an option buttons
Hi, I have option group in from to add values in table. These options use to add a percentage to the table. The first one has 50% labels; the second one has 55% and so on to 100%. The problem is when I retype the value of each option from 1 to 0.50 the value returns to 0. Can any body help me revaluing the value of each option? Thanks!! Check the field type, if its Long or Integer it will round the number and 0.5 will turn into 0. Change the field type to Double or Single -- Good Luck BS"D "Jon" wrote: > Hi, > I have option group in from to add values in table...

Validation Options with option List
Good morning! i have set up an validation list option in Excel so i can choose what option to pick. For example, i can choose test1, test2 and/or test3. But what i want to try to do is when i choose one of the options test1,test2 and/or test3 i want for those options different fields like for example: Test1 this is the text of data for test1 When i choose the option Test2 i want the text or data cleared for test1 and see the text for option 2. I hope you can help me with this problem, thanks in advanced! Edo -- EdoZwart ---------------------------------------------------------------...

Insert options
I've recently been "upgraded" to Office 2010 from Office 2003 and find the "Ribbon" interface really horrible. A good example is in Excel. In Excel 2003 if I wanted to insert a row or column it was simple. Go to the insert menu and select either rows or columns. To do the same task in Excel 2010 the logical place to go is the "Insert" ribbon. This lets me insert lots of things, but none of them are rows or columns. To do that I have to go to the "Home" ribbon and then there is an Insert button from where I can insert rows or columns. I thought one ...

data validation
Is it possible to create a similar function like data validation, from which I can select multiple options? (Background: I need a list of many names, from which I case by case can select). Not really. Maybe you could use a listbox. I added a listbox from the Forms toolbar to a worksheet. I called it "List Box 1". I rightclicked on that listbox and chose Format Control. On the Control tab, I chose Selection Type of Multi. I also pointed at the range that held the values that go in that listbox. Then I added a button from the Forms toolbar (I click the button when I'm d...

Problems with Excel Horizontal arrays with regional options using.
Entering a vertical array ={10;20} works ok, but horizontal array ={10,20} gives 10,2 ;-) in both cells instead of 10 and 20 in the two cells. This happens, I presume, because I work with a comma as decimal separator and NOT with the American . I do suppose that Excel has got some solution for this behaviour. I, in principle, do NOT want to change the regional options. ...

Program Name Options
I cannot find the Program Name Options when I select Microsoft Office Button. It is not there. How do I get it? Look in the lower right corner of the block, just inboard of the Exit "X" Richard LeBlanc wrote: > I cannot find the Program Name Options when I select Microsoft Office > Button. It is not there. How do I get it? Thanks "Bob I" <birelan@yahoo.com> wrote in message news:u7UaEj6vKHA.5940@TK2MSFTNGP02.phx.gbl... > Look in the lower right corner of the block, just inboard of the Exit "X" > > Richard LeBlanc wrote...

Second Calendar Option?
Outlook 2000. This is probably a very easy question (I hope). How do I setup a second apptoinment calendar so I can keep my personal appointments seperate from business ones? -- Thanks in advance... Bob File | New | Folder. But if you want to get reminders from the second calendar, you'll need the tool from http://www.slovaktech.com . A better approach might be to use different categories for personal and business appointments and a filtered view. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developer...

SOL_SOCKET Socket Options?
Hello everyone I use the following code to set send timeout and receive timeout for HTTP request but the timeout is about 60 seconds in Windows 98, not 15 seconds which I expect My question is Do Socket Options SO_SNDTIMEO and SO_RCVTIMEO not work in Windows 98 +++++++++++++++++++++++++++++++++ #include "winsock2.h . . m_nSendTimeout=5000 m_nRecvTimeout=10000 . . //set recieve timeou if(setsockopt(sckHTTPSocke ,SOL_SOCKE ,SO_RCVTIME ,(const char *)&m_nRecvTimeou ,sizeof(m_nRecvTimeout))!=0 closesocket(sckHTTPSocket) return //set send timeou...

SOCKET #3
Hi, Can I use Winsock to communicate between two process on the same computer but without network card??? THANKS. Dave wrote: > Hi, > Can I use Winsock to communicate between two process on the same computer > but without network card??? You don't need a network card to install a Microsoft Loopback adapter then you have a local NIC driver without a NIC. At that point you could simply use WinSock as documented and connect to localhost (better) or the assigned IP address on the Loopback adapter. I mention this method only because I suspect (but don't actually know) th...

Add Unit of Measure Sched on the SOP Blank Options Invoice Form
Add the Unit of Measure (UoM) Schedule ID uniquely per line item in the SOP Blank Options Invoice Form. When you add the Sales Transaction Amounts Work* and the Item Master to the report, and then pull the 'U of M Schedule' from the Item Master, the UoM Schedule ID is duplicating. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-...

optional saving of sent items in sent item folder
Hi All, I feel a need to have check box in New Email Compose form which if unchecked does not save outgoing email in Sent Item folder....How can I achieve that ? -TIA There already is such a checkbox on the Options dialog. Otherwise, this can be done with a custom message form. However, you really don't want to make a custom form your default, because it will cause problems with non-Outlook recipients, especially when sending attachments. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers ht...

Money 2004
If anyone has any -Positive- experience with Money 2004 and Equity Options, please post them. I figure that either: - Microsoft doesn't have anyone on their Money team with any experience trading options? - They're targeting Money for Joe Sixpack, who is more concerned with paying the minimum payment on his Visa bill at the last possible minute via epay. Here are my main issues: 1. Money 2003 can't import buy/sell transactions for Equity Options. (Equity transactions from my Vanguard and Scottrade accounts are imported just fine.) You can MANUALLY enter Equity Option transact...

get rid of macro option at startup
I created and then deleted a macro in an Excel file. Why do I still get the warning box (i.e. the one asking if I want to enable or disable macros) when I open the file? Is there a way to get rid of this since I no longer have macros in this file? Thanks. Brad You need to delete the empty module.! Bill K "Brad Rench" <brench@comcast.net> wrote in message news:kSOdnb0Jjst9afaiXTWJkg@comcast.com... > I created and then deleted a macro in an Excel file. > > Why do I still get the warning box (i.e. the one asking if I want to enable > or disable macros) when I o...