IB designed the SDK ABI without special consideration to what we call "messages" (from them to us) , they are like "errors" (from them about us, understand bad behavior of our own code)
Do not consider everything that come through the error 'channel' as error. Even if it means something is not OK, it doesn't mean you can do something or that your code is culprit. (While generally this is the case)
They just inform you that there is reason your code doesn't behave as you expect and generally, they auto-fix it.
The 2157 you mention seems more frequent outside RTH (I suspect because they may do maintenance and reduce active farms),
There is nothing you can really do about it. It should? reconnect by itself a couple of second later and issue a 2158 Error code.
,{??? 2158,LOG_TRACE??? ,ACT_NOACTION,??? "Sec-def data farm connection is OK ",??? "A notification that connection to the Security definition data server is ok. This is a notification and not a true error condition, and is expected on first establishing connection ."}
? but 2157 doesn't seems a documented one
If very critical you can try the lengthy process of closing your connection and re-opening it. but before considering new dev, check first that after your 2157 you do receive (or not) an error-message 2158 in a timely manner that may suite you.