Saturday, 24 October 2020
  11 Replies
  5.2K Visits
  Subscribe
Hi, I recently started a new project where the websocket client attempts to connect to a server every 5 seconds if its not connected. This is done under a timer. I've noticed rare #10083 popups and noticed they show up mostly when I'm using a VPN but also does when I'm not.

https://i.imgur.com/vq1Zkaz.png
4 years ago
·
#553
Accepted Answer
Hi,

A 10038 error usually means 2 things:

1. The socket has not been initialized and is trying to call some action.
2. This socket has been already closed and is trying to use it.

If your application is multithreaded, maybe one thread close the socket while other thread is trying to use it and then you get this error.

Some users reported than executing the following windows commands as admin and then restarting it solves the problem (never tried so)

netsh winsock reset
netsh int ip reset

Kind regards,
Sergio
4 years ago
·
#571
Hello,

Yes, this is enough, if there is any error will be catched.

Kind regards,
Sergio


Seems like it. Thanks again.
4 years ago
·
#570
Hello,

Yes, this is enough, if there is any error will be catched.

Kind regards,
Sergio
4 years ago
·
#569
Hi, So I should just put the checking in a try except to catch it? My code is as follows:
fYzDhBprkI.png
Attachments (1)
4 years ago
·
#568
Hi,

If you first check if Active property is False before set Active := True, you can get an exception reading Active property because internally calls to Connected property of Indy Socket connection, so an 10038 exception can be raised. But when you call Active := True, if there is any exception will be catched OnException event. So most probably you get the exception checking if connection is active or not.

Kind regards,
Sergio
4 years ago
·
#566
The connection is happening in a timer yes with a connect timeout of 1 second and the timer attempts a connection every 5 seconds. I tried to catch it on the "OnException" event however it does not seem to come from there. I will attempt to put a try except over the connection attempt to suppress it.
4 years ago
·
#565
Hello,

Do you use WatchDog property of TsgcWebSocketClient or you use your own TTimer? if first, it there is any exception trying to connect it should be catched and throw to OnException event (at least with latest version). If your use your own TTimer, maybe the error is that while try to connect is still disconnecting from previous attempt to connect and client is still not initialized.

Kind regards,
Sergio
4 years ago
·
#564
Hi, some of my customers are getting spammed by this and do not want to run those commands while some have reported it fixes nothing. Is it possible to suppress it?
4 years ago
·
#563
Some of my customers are getting spammed by this. Is it possible suppress this? Most of them don't want to run those commands.
4 years ago
·
#555
Hi,

Thanks for your feedback!

Kind regards,
Sergio
4 years ago
·
#554
I want to confirm that those commands worked. I left it running for a day and have not since had that popup again.
4 years ago
·
#553
Accepted Answer
Hi,

A 10038 error usually means 2 things:

1. The socket has not been initialized and is trying to call some action.
2. This socket has been already closed and is trying to use it.

If your application is multithreaded, maybe one thread close the socket while other thread is trying to use it and then you get this error.

Some users reported than executing the following windows commands as admin and then restarting it solves the problem (never tried so)

netsh winsock reset
netsh int ip reset

Kind regards,
Sergio
  • Page :
  • 1
There are no replies made for this post yet.
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below.
Supported: gif,jpg,png,jpeg,zip,rar,pdf,pas,dfm,dpr,dproj,dpk
· Insert · Remove
  Upload Files (Maximum 10MB)