3

I've seen other people reporting the System.Net.Sockets.SocketException exception, but they largely involve web services. We're not calling any web services. In fact, this ASP.NET app is a single-tier app with the UI and data layer contained in a single assembly. To retrieve data, we manually open a connection, create a command, and execute a reader or use a data adapter to fill a data table before delivering it to the page.

A few times per month when trying to execute a command, we get System.Net.Sockets.SocketException. I have no idea what could be causing this. As stated in the subject, we're accessing Teradata database, so we use TdConnection, TdCommand, TdDataAdapter.

cmdSolutionName = New TdCommand(sSql, Con)
daSolutionName.SelectCommand = cmdSolutionName
daSolutionName.Fill(tmpTable) 'Exception is thrown here

Does anyone know what could cause this exception when working directly with a database connection and not a web service?

oscilatingcretin
  • 10,457
  • 39
  • 119
  • 206

1 Answers1

3

I saw the same error at my work when we used .Net Remoting to connect to another host. The .Net Remoting is using TCP\IP protocol, i believe the TdCommand also use this protocol. the source of the problem that i discovered was a "Trend Micro" process, it's an antivirus that hijacks all live sockets on port 8080. maybe, your antivirus is running a scan at 'that time of the month' and killing all your communication. if not, try to think maybe of another process that can be this harmfull.

Boolean
  • 126
  • 5
  • Very interesting find. Our local dev machines have Trend Micro installed. The production box has a running service called Trend ServerProtect which is developed by Trend Micro. Obviously, I couldn't reconfigure it on the server myself, but do you have any idea how it *could* be reconfigured so that this potential hijackery can be stopped? – oscilatingcretin Jul 05 '12 at 12:22
  • It is a bug of "Trend Micro", I asked my IT team to work with a POC from "Trend Micro" on that. try to use their service. for now, just to make sure, remove the installation or disable the scan and see if you stop getting the "SocketException". – Boolean Jul 06 '12 at 05:01
  • Due to lack of other answers/input, I am giving you the answer and bounty. I find it to be an odd coincidence that you mentioned Trend Micro when that's exactly what we use, so I'll pose more details if and when I find more about this. – oscilatingcretin Jul 07 '12 at 18:24
  • i would recommend you to use this command line while your app is crashing with the "SocketException" and type: **netstat -aon** open the task manager on the processes tab, add the "PID" column and search for the "Trend Micro" PID on the task manager, then look for this PID open communications in the output from the command line. this is how i found out about the "hijacked" sockets – Boolean Jul 08 '12 at 07:02