Jump to content
Mark-

Unknown error... #87

Recommended Posts

Hello,

 

I have a customer when opening a form with a TWSocket on it gets the following error:

 

Error reading PrimaryTCP.ReqVerLow: Not a Winsocket error (#87 in SetReqVerLow: WinSock version can't be changed now).

 

I have no idea the cause.

 

Any ideas?

 

Thanks,

 

Mark

 

Share this post


Link to post

I think that property goes back to Windows XP or something when there were different versions of winsock.  But they currently default to 2 and need never be changed. 

 

You should only get that error if your application tries to change ReqVerLow after TWSocket has loaded, and why would you want to?

 

Angus

Share this post


Link to post

Thanks for the response.

 

> ReqVerLow after TWSocket has loaded, and why would you want to?

 

I would not want to and if this is the ReqVerHigh and ReqVerLow in the object inspector they are both set to 1 and I did not set them.

Edited by Mark-

Share this post


Link to post

OK I found the error.

We added some code, earlier in program execution, nothing to do with the TWSocket generating the error, using THttpCli. It is initialized first and CtrlSocket.ReqVerLow and CtrlSocket.ReqVerHigh are indeed set to 2.

 

Now creating the TWSocket port, when the form opens using 1, as was streamed with the form, causes the crash.

So we change all the TWSockets to 2 or set the THttpCli to 1.

Edited by Mark-

Share this post


Link to post

Not sure how that could happen, THttpCli does not reference ReqVerHigh or ReqVerLow and the underlying TWSocket is not accessible for writing in current versions.  ReqVerHigh or ReqVerLow would only be saved in the DFM if you changed them from the default of 2, again unless you are using an ancient version of ICS.

 

Angus

 

Share this post


Link to post

OK, here is how.

 

This program was started 13 years ago. Still going strong. 😉

 

Using the current version of ICS.

I have 40+ old/still using forms/DMs with TWSocket on them, created years ago.

All these DFMs had 1 the for the low and high property. I did not change/set/alter the ReqVerHigh or ReqVerLow properties.

No, problem all works and has been for years.

In the previous two months an THttpCli was added and it is called/loaded/used first in the program.

It is dynamically created and the default for the CtrlSocket(TWSocket) is indeed 2 as you stated.

 

Now, the program starts, Winsock 2 is used by the THttpCli, one of the old DFMs is used/loaded and kaboom.

 

> ReqVerHigh or ReqVerLow would only be saved in the DFM if you changed them from the default of 2,

 

ReqVerHigh = 1 and ReqVerLow = 1 was in all the DFMs that had a TWSocket. I grepped and replaced them all with 2 and problem solved.

 

Perhaps I should remove them all and let the current version default value apply.

 

 

Edited by Mark-

Share this post


Link to post

If you can do so easily, removing ReqVerHigh and ReqVerLow from the DFMs is safest, maybe an earlier release of Delphi stored default values or you set them to 1 after the default changed to 2, when is not noted in the unit  Can not see the winsock version changing again in my life time.  

 

The next low level change is likely to be QUIC which Google has been developing for several years, this uses UDP for TCP like streams, so should not involve winsock, it should be supported by OpenSSL within a year or so, once the spec is finalised. 

 

Angus

 

Share this post


Link to post
1 hour ago, Angus Robertson said:

If you can do so easily, removing ReqVerHigh and ReqVerLow from the DFMs is safest...

I concur and it is done.

Thanks for your help.

Edited by Mark-

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×