[go-nuts] DNS Resolver options
Hello, I would like to control the dns lookup timeout, the number of retries and also the ability to use TCP for the DNS resolution. I am from the C/C++ world and c-ares has options to control these. I am not findiing either of these as options in the go net package. Am I not looking in the right place or is there a package that I should use. Thanks, pushkar -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: DNS Resolver options
Thanks Dave. I am aware of that repo but it doesn't provide an abstraction of the resolver functionality. I found https://github.com/bogdanovich/dns_resolver which is written using miekg/dns. It is lacking some of the options that libraries like c-ares have (using TCP and controlling timeout). I think I can extend it by figuring out how to force a TCP query and timeout the query, but wanted to check with the group if I am overlooking something. On Wednesday, October 11, 2017 at 1:58:47 PM UTC-7, Dave Cheney wrote: > > Try https://github.com/miekg/dns -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Blocking in C functions called from go
I need to call some C functions from Go. I think I know how to proceed using cgo. However, I was wondering how goroutines and blocking calls in the C functions work together. So in the below example (pseudocode) will the goroutine be suspended when the pthread_lock call is waiting to acquire the lock? I am guessing that the Go engine will detect that the OS thread on which the goroutine(s) are running is blocked so it will suspend them too. Once the thread is runnable, the blocked goroutines will be scheduled to run. For example: int cfunc (int a) { pthread_lock(..); ++a; pthread_unlock(); } func main() { for (i := 0; i < 100; i++) { go cfunc(i) } } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] cgo multiple definition errors
I was getting the multiple definition error when I put my C files in the same directory as my go files. Only after reading some online posts I figured I should put my code into a separate directory. The introductory page to cgo doesn't mention this. It would save newbies some time if did: https://blog.golang.org/c-go-cgo Using go1.8.3 on Linux. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.