Odd "socket: An invalid argument was supplied." problem, does not happen from go run ...

361 views
Skip to first unread message

Andrew Price

unread,
Oct 14, 2016, 1:07:17 AM10/14/16
to golang-nuts
I have a program that accesses a MS SQL Server via github.com/denisenkom/go-mssqldb. This from my windows 7 dev box.

It works beautifully when I start it by "go run prog.go", but when started as just "prog.exe" it gives the dreaded "dial tcp 10.1.11.23:1433 socket: An invalid argument was supplied." error.

Connection strings are identical in both cases.

I haven't tried on linux yet.

Any ideas anyone?

Thx

Andy

Konstantin Khomoutov

unread,
Oct 14, 2016, 2:21:57 AM10/14/16
to Andrew Price, golang-nuts
Windows firewall issue by any chance?

`go run` works in a way that the resulting temporary application is run
by a Go host process; when you run your built application, it's started
by another process -- a console process or Explorer or whaterev --
depending on how do you start it. Since Windows firewall is tightly
integrated with the userspace this could make a difference IMO.

Andrew Price

unread,
Oct 14, 2016, 4:04:32 PM10/14/16
to golang-nuts, apric...@gmail.com
That sounds about right. I'll try launching using some other method than the windows cli and see if that helps :)


Reply all
Reply to author
Forward
0 new messages