Profile Picture

IO Exception - TWS

Posted By alpha23 7 Years Ago
Message
Posted Wednesday April 14 2010
I received the following exception using the RightEdgePlugins-ab646c8 downloaded code and RE2010 build 15. Both VS and RE exception messages are shown. When reviewing the live system, ticker data had was not being received even during regular trading hours. Note, the live system was started the night before during non-trading hours.

Restarting TWS resolved the issue; however, this is not ideal because the live system is always started the night before.

Please advise.

Thanks, Duane

From VS
System.IO.IOException was unhandled by user code
Message="Unable to write data to the transport connection: An established connection was aborted by the software in your host machine."
Source="System"
StackTrace:
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.BinaryWriter.Write(Byte[] buffer)
at Krs.Ats.IBNet.IBClient.send(String str)
at Krs.Ats.IBNet.IBClient.send(Int32 val)
at Krs.Ats.IBNet.IBClient.CancelMarketData(Int32 tickerId)
at RightEdge.TWSCSharpPlugin.TWSPlugin.SetWatchedSymbols(List`1 symbols)
at RightEdge.Shared.TickWrapper.SetWatchedSymbols(List`1 symbols)
InnerException: System.Net.Sockets.SocketException
Message="An established connection was aborted by the software in your host machine"
Source="System"
ErrorCode=10053
NativeErrorCode=10053
StackTrace:
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
InnerException:

From RE
The service plugin RightEdge.TWSCSharpPlugin.TWSPlugin threw an exception of type System.IO.IOException
at RightEdge.Shared.ServiceWrapper.DoError(Exception e)
at RightEdge.Shared.TickWrapper.SetWatchedSymbols(List`1 symbols)
at RightEdge.Shared.LiveDataManager.RemoveSymbol(Symbol symbol)
at RightEdge.Shared.LiveDataManager.StopService(String serviceName)
at RightEdge.Shared.LiveDataManager.StopAll()
at RightEdge.xfb471916970b0c9e.StopAll()
at RightEdge.xf266856f631ec016.x3c9d53e9e6cef5ab()
at RightEdge.xf266856f631ec016.x25c6fd65e4bb70a3(Object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)

Inner Exception:
An exception of type System.IO.IOException was thrown.
Unable to write data to the transport connection: An established connection was aborted by the software in your host machine.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.BinaryWriter.Write(Byte[] buffer)
at Krs.Ats.IBNet.IBClient.send(String str)
at Krs.Ats.IBNet.IBClient.send(Int32 val)
at Krs.Ats.IBNet.IBClient.CancelMarketData(Int32 tickerId)
at RightEdge.TWSCSharpPlugin.TWSPlugin.SetWatchedSymbols(List`1 symbols)
at RightEdge.Shared.TickWrapper.SetWatchedSymbols(List`1 symbols)

Inner Exception:
An exception of type System.Net.Sockets.SocketException was thrown.
An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
Posted Wednesday April 14 2010
It looks like TWS closed the connection to the plugin. TWS has a "feature" where it will automatically log off at a certain time every day, my guess is this is what happened.

Daniel
Posted Thursday April 15 2010
This was not due to TWS logging off because I have the log off time set to 7 PM local and the system was started after 10 PM. The exception was triggered the following morning after noticing that trades were not being sent to TWS and restarting the live system.

Please let me know your thoughts in order to prevent future occurrences.

Thanks, Duane
Posted Friday April 16 2010
Hi Duane,
"Unable to write data to the transport connection: An established connection was aborted by the software in your host machine"

is the meat of the exception. The question is what could have caused this? Also, I'm not sure short of reconnecting that there is much we can do. We're working on ways to get around one time connection failures.

dwebber (4/15/2010)
This was not due to TWS logging off because I have the log off time set to 7 PM local and the system was started after 10 PM. The exception was triggered the following morning after noticing that trades were not being sent to TWS and restarting the live system.

Please let me know your thoughts in order to prevent future occurrences.

Thanks, Duane
Posted Friday April 16 2010
Doing a web search on the error message ("An established connection was aborted by the software in your host machine") indicates that this is usually due to a firewall or virus scanning program. Apparently some firewalls will close connections that are idle for a long time.

If that's not it I'm not sure what other advice to give you. The exception means that something external to RightEdge closed the connection.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems