S SAM ShamsulBahrim Member Licensed User Longtime User Feb 10, 2014 #1 Hi, I wonder if someone can assist me as I once a while do get the following pop up error "address already in use (EADDRINUSE)" upon I click to run my B4A apps. Indeed, I do have UDP and TCP sockets in my apps...and I also found this link "http://stackoverflow.com/questions/...ror-message-eaddrinuse-address-already-in-use" suggesting about: You need to set SO_REUSEADDR before binding. Don't specify port in the constructor - create unbound socket instead with DatagramSocket(null), then set options, then bind() explicitly. Any idea how to overcome the problem?
Hi, I wonder if someone can assist me as I once a while do get the following pop up error "address already in use (EADDRINUSE)" upon I click to run my B4A apps. Indeed, I do have UDP and TCP sockets in my apps...and I also found this link "http://stackoverflow.com/questions/...ror-message-eaddrinuse-address-already-in-use" suggesting about: You need to set SO_REUSEADDR before binding. Don't specify port in the constructor - create unbound socket instead with DatagramSocket(null), then set options, then bind() explicitly. Any idea how to overcome the problem?
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2014 #2 You are trying to open a port that is already open. Upvote 0
S SAM ShamsulBahrim Member Licensed User Longtime User Feb 10, 2014 #3 Erel said: You are trying to open a port that is already open. Click to expand... Thanks Erel. I placed my socket.close in the wrong place (under the Activity_Pause Sub). I've closed the socket under "If UserClosed = False". Now I placed it as the following: Sub Activity_Pause (UserClosed AsBoolean) If UserClosed = False Then Else myUDP.Close End If End Sub Upvote 0
Erel said: You are trying to open a port that is already open. Click to expand... Thanks Erel. I placed my socket.close in the wrong place (under the Activity_Pause Sub). I've closed the socket under "If UserClosed = False". Now I placed it as the following: Sub Activity_Pause (UserClosed AsBoolean) If UserClosed = False Then Else myUDP.Close End If End Sub