Thanks in advance.
Currently I am working on simple node application on multi user environment ( i.e.. more than one user login at the same time instead of logout other user before switching sign in to new user ) and my node application is running in one port[ Eg: 3000].
My code:
service.listen( 3000, "127.0.0.1",
() => {
console.log( "Service successfully running Port 3000" );
} )
.on( "error", ( errorMessage: any ) => {
console.log( error Message );
} )
.on( "uncaughtException", ( exception: any ) => {
console.log( exception );
} );
In this situation other user login to the same VM and he also trying to run another node application with same port [3000]. But it seems port is already running so it return with error.
So I want to understand how ports are working in multi user environment. specifically more than one user login in at the same time?
Is that possible to prevent/reserve the port for current user in shared environment.
Note: If user1 logout before switching to user2. It works properly as expected. user2 able to use the same port.
Could you some one help on this?
Expecting to prevent the node service for current user alone instead of sharing to other user.