mSql 4.1 IP socket
Posted: Wed Jan 10, 2018 1:15 pm
Just downloaded and compiled mSql 4.1 and was tearing my hair out (yes, I have some left) trying to get clients to connect via the TCP socket... which should only require setting the port and setting Remote_Access True in the msql config file.
I turned on "general" debugging and compared output to the source code, and could not see any messaging about the IP Port which should be printed in setupServerSocket() if the code takes the "if" case where Remote_Access is set.
Then I added a MSQLDebug0() call in the "else" case (the case where Remote_Access is false) and still got nothing. Finally changed the debug to a printf() and finally got my message of "NO IP Port" from the "else" case... indicating that Remote_Access was not set (even though I set it True in the config) nor was MSQLDebug working since the MSQLDebug0 didn't print anything but my printf did.
Finally after a bunch of throwing pasta at the wall, I discovered that setupServer() is called AFTER setupServerSockets() and, since the configuration file is read in setupServer(), that meant that the config file hadn't been read yet when doing the server sockets, and thus there was no port. Furthermore, the debug state isn't set yet either since that's also done in setupServer()!
I confirmed this by swapping the order (so setupServer ran first) and... guess what... now my IP socket works and I even get all the debug output.
I'm wondering how it is supposed to work in the package as distributed? What am I missing?
I turned on "general" debugging and compared output to the source code, and could not see any messaging about the IP Port which should be printed in setupServerSocket() if the code takes the "if" case where Remote_Access is set.
Then I added a MSQLDebug0() call in the "else" case (the case where Remote_Access is false) and still got nothing. Finally changed the debug to a printf() and finally got my message of "NO IP Port" from the "else" case... indicating that Remote_Access was not set (even though I set it True in the config) nor was MSQLDebug working since the MSQLDebug0 didn't print anything but my printf did.
Finally after a bunch of throwing pasta at the wall, I discovered that setupServer() is called AFTER setupServerSockets() and, since the configuration file is read in setupServer(), that meant that the config file hadn't been read yet when doing the server sockets, and thus there was no port. Furthermore, the debug state isn't set yet either since that's also done in setupServer()!
I confirmed this by swapping the order (so setupServer ran first) and... guess what... now my IP socket works and I even get all the debug output.
I'm wondering how it is supposed to work in the package as distributed? What am I missing?