erlyaws / yaws

Yaws webserver
https://erlyaws.github.io
BSD 3-Clause "New" or "Revised" License
1.28k stars 267 forks source link

Is yaws_websockets:close supposed to close the TCP connection? #356

Closed MayamaTakeshi closed 5 years ago

MayamaTakeshi commented 5 years ago

I'm using yaws-2.0.6.

If in my handle_open I return:

   {error, Reason}

yaws sends WebSocket message with opcode 8 and closes the TCP connection.

However, if I accept the connection:

  {ok, State}

and later I decide to close it by using:

  yaws_websockets:close(WSState, Reason)

yaws sends WebSocket message with opcode 8 but it doesn't close the TCP connection.

Is this expected behavior?

vinoski commented 5 years ago

Yes, this is expected.

MayamaTakeshi commented 5 years ago

Understood. Thank you.