Skip to content

Conversation

@rolancia
Copy link

Hi Sir,

i faced an error when writing on socket with multi users.

i had checked out below you used
'https://github.com/nodejs/node/blob/master/lib/net.js'

it calls 'emit('close', ...) after already closed, so assumed your '_closed' value might be not synchronized.

Thank you
Rolancia

@rolancia
Copy link
Author

rolancia commented Jan 16, 2020

if users didn't put error handler, the process will be terminated when exception occurs while calling _socket.write in 'sendMessage' due to the default error handler kills the process with exit code 1.

i thought the user using this library may not want to face the exception. it might happen very rarely but it will happen someday. example, i had encountered that everyday.

i think the throwing code i put can prevent that
(in the beginning i put a code defining default handler but it could be bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant