mathpaquette / IQFeed.CSharpApiClient

IQFeed.CSharpApiClient is fastest and the most well-designed C# DTN IQFeed socket API connector available
MIT License
120 stars 43 forks source link

Calling iqfeed running on a windows pc #164

Closed bryaan closed 3 weeks ago

bryaan commented 3 weeks ago

I have iqfeed client running on a local network pc, and am trying to connect to it from a mac.

I added the hostname to my hosts file. I can ping the pc from my mac using the hostname.

LookupClientFactory.CreateNew("MAXIMUS", 9100, numberOfConcurrentClients);

I have opened up all iqfeed ports on windows defender.

But when I try to connect it gives me:

Unhandled exception. System.Net.Sockets.SocketException (60): Operation timed out 10.0.1.40:9100
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at IQFeed.CSharpApiClient.Socket.SocketClient.Connect()
   at IQFeed.CSharpApiClient.Lookup.LookupDispatcher.ConnectAll()
   at IQFeed.CSharpApiClient.Lookup.LookupClient.Connect()
BunkerCoder commented 3 weeks ago

iqconnect.exe listens on ports 9x00 on the loopback address, not the LAN-facing IP address. If it worked the way you're trying to do it, everyone on the LAN could share the connection, which would violate the DTN license. Take a look at https://www.geeksforgeeks.org/what-is-a-loopback-address/