Answer the question
In order to leave comments, you need to log in
Why does a network application for Android hang on GOLANG?
Hello! I have an interesting question for experienced android developers.
I have a desire to implement a simple traffic analyzer for android based on socks5proxy.
Unfortunately, I don’t know JAVA, but I know a little GO, so I wrote the implementation of socks5 in pure GO.
I tested the resulting service on Linux and everything worked fine on Windows.
Using gomobile, I compiled the library and connected it to android studio. I hung up the start of the service on the button (calling just one function from go, nothing more).
Everything works fine for a while, but then something very strange happens:
1. The service stops responding over the network.
2. The application itself does not crash the button is pressed
3. No new messages appear in logcat and the logcat window itself hangs along with andoid-studio. Nothing is pressed until you kill the emulator. After nailing the emulator, the error "error: EOF" appears, but the environment hangs and the slave is then fine
4. Sometimes the emulator itself crashes with such an error.
PANIC: .//android/sockets.c:1002:socket_recvfrom: System call looped around EINTR 100 times: recvfrom(fd,buf,len,0,sa.sa,&salen)
What could this be?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question