@Override
public void onTextFrame(final WebSocketSession session, final WebSocketFrameHeader header, final CharSequence payload) {
synchronized (sessions) {
Iterator<WebSocketSession> it = sessions.iterator();
while (it.hasNext()) {
final WebSocketSession sess = it.next();
try {
sess.sendText(payload);
} catch (IOException e) {
it.remove();
}
}
}