0 votes
by (120 points)

We get a lot of 10038 socket exceptions using Rebex.Net.Ftp.Connect and A) we are trying to reduce those and B) see if repeated instances of these exceptions can cause system instability... i.e. problems with other applications using WinSock ?

Do you guys have any advice on what we can do to try to avoid these and do you any insight into what the consequences of possibly having over a hundred of these in one day could do to the operating system?

Below is the output from the Rebex.Ftp trace log that is relevent

INFO Ftp(9)[161488450] Info: Assembly: Rebex.Ftp 2018 R2.1 for .NET Compact Framework 3.5
INFO Ftp(9)[161488450] Info: Platform: Windows CE 7.0.2882 32-bit; CLR: 3.5.19072.0
DEBUG Ftp(9)[161488450] Info: Culture: en; windows-1252
Ftp(9)[161488450] Info: Using proxy none
Info: Rebex.Net.FtpException: Socket error 10038 occured. ---> Rebex.Net.ProxySocketException: Socket error 10038 occured. ---> System.Net.Sockets.SocketException: An operation was attempted on something that is not a socket
at System.Net.Sockets.Socket.ConnectNoCheck(EndPoint remoteEP)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at wsit.Connect(EndPoint remoteEP)
at wsiw.vxrr(IPEndPoint ds)
at wsiy.Connect(EndPoint endPoint)
at Rebex.Net.ProxySocket.Connect(EndPoint remoteEP)
at Rebex.Net.ProxySocket.Connect(String serverName, Int32 serverPort)
at eeoi..ctor(Ftp oe, ISocketFactory of, String og, Int32 oh)
at Rebex.Net.Ftp.pgdg(String ev, Int32 ew, TlsParameters ex, SslMode ey, FtpSecureUpgradeType ez)
at Rebex.Net.Ftp.pgdf(String eq, Int32 er, TlsParameters es, SslMode et, FtpSecureUpgradeType eu)
at Rebex.Net.Ftp.Connect(String serverName, Int32 serverPort, SslMode security)
at FtpPush.FtpRebex.TryConnectToFTPServer()
at FtpPush.TargetFtp.InitializeFtpRebexList(UpDown UpDw)
at FtpPush.TargetFtp.OpenFtps(UpDown UpDowx)
at FtpPush.FtpSession.Uploading(List1 TargLactive, Boolean AssosiatedToConmgrCE, ConnWay connectWay) at FtpPush.FtpSession.StorageLoop() at Rebex.Net.ProxySocket.Connect(EndPoint remoteEP) at Rebex.Net.ProxySocket.Connect(String serverName, Int32 serverPort) at eeoi..ctor(Ftp oe, ISocketFactory of, String og, Int32 oh) at Rebex.Net.Ftp.pgdg(String ev, Int32 ew, TlsParameters ex, SslMode ey, FtpSecureUpgradeType ez) at Rebex.Net.Ftp.pgdf(String eq, Int32 er, TlsParameters es, SslMode et, FtpSecureUpgradeType eu) at Rebex.Net.Ftp.Connect(String serverName, Int32 serverPort, SslMode security) at FtpPush.FtpRebex.TryConnectToFTPServer() at FtpPush.TargetFtp.InitializeFtpRebexList(UpDown UpDw) at FtpPush.TargetFtp.OpenFtps(UpDown UpDowx) at FtpPush.FtpSession.Uploading(List1 TargLactive, Boolean AssosiatedToConmgrCE, ConnWay connectWay)
at FtpPush.FtpSession.StorageLoop()
at Rebex.Net.Ftp.pgdg(String ev, Int32 ew, TlsParameters ex, SslMode ey, FtpSecureUpgradeType ez)
at Rebex.Net.Ftp.pgdf(String eq, Int32 er, TlsParameters es, SslMode et, FtpSecureUpgradeType eu)
at Rebex.Net.Ftp.Connect(String serverName, Int32 serverPort, SslMode security)
at FtpPush.FtpRebex.TryConnectToFTPServer()
at FtpPush.TargetFtp.InitializeFtpRebexList(UpDown UpDw)
at FtpPush.TargetFtp.OpenFtps(UpDown UpDowx)
at FtpPush.FtpSession.Uploading(List`1 TargLactive, Boolean AssosiatedToConmgrCE, ConnWay connectWay)
at FtpPush.FtpSession.StorageLoop()

Applies to: Rebex FTP/SSL

1 Answer

0 votes
by (147k points)

We have seen lot of these strange "An operation was attempted on something that is not a socket" errors on devices running .NET Compact Framework 3.5, and in our experience, it's a symptom of lost network connectivity. We also believe this is a bug in .NET CF, because it does not make sense for a method of .NET's Socket class to claim the operation was attempted on something that was not a socket.

In fact, these errors have been so common that we added a workaround in a later version that simply raises a "Connection has been lost" exception instead.

We also added a connection manager API to make it easier for app developers to make sure the connection keeps active during the FTP session's lifetime. Previously, lot of developers simply performed a dummy HTTP request using .NET's WebRequest API to establish a connection - but that was a common cause of 10038 errors because connections established that way were not aware of the FTP session and could disconnect within several minutes while the FTP session was still active.

Overall, I would say that 10038 errors are a symptom of connectivity instability rather than a cause of system instability, and under normal circumstances their presence should not have detrimental effects on the OS. However, we know that Windows CE operating systems are rather peculiar, with substantially more bugs than mainstream Windows editions (which are never going to be fixed because those systems are end-of-life already). So it would not surprise me if repeated connectivity losses did cause some issues.

Additionally, if you are experiencing any resource leaks, it might be useful to try an up-to-date version of Rebex FTP because 2018 R2.1 is almost 5 years old and we addressed some issues in the meantime: https://www.rebex.net/kb/legacy-editions-release-history/

...