How many socket session can keep in one account?

I check the program log ,found It close by server many time in one day: code:1000 reason:Bye,and 1005 with shutdown reason:DeviceQuotaReached,
My account is live account, but money is no much,below $1000 (some loss happend after buy api key)
is there only one session limit in one account ?
when my program login in so the Tr client(web or desktop) will be logout? and if the TR client login after program,the program will be logout?
if I reconnect when received shutdown or close message, it has some rate limit? for example ,it need wait 5 second to reconnect when received shutdown .

if I run a program in demo, I can run another program in replay mode?

Unless you pay for 2 devices, you can only have one active session. Using your API Key to request an access token will begin a session, and will boot off the oldest session.