Alright, so, Code 3 is a generic return that simply means that a TCP connection was forcibly closed. This means that your connection to the server was terminated, but does not address how or why. If the console is not returning any other error codes for us to query it is likely that you are experiencing a standard disconnect.
Please check to make sure that all of the connections for BeamMP and BeamNG are allowed through your firewall and that your network is actually strong enough to support online play. If you find no success in connecting to our services you can attempt to follow the same set of instructions listed in Fixes for Being Unable to Log In. Lastly, you might want to contact your ISP to query them about any continued issues.