onRequest method

  1. @override
void onRequest(
  1. SocketConnect connect
)
override

Implementation

@override
void onRequest(SocketConnect connect) {
  var res = connect.request.response;

  if ('GET' == connect.request.method) {
    onPollRequest(connect);
  } else if ('POST' == connect.request.method) {
    onDataRequest(connect);
  } else {
    res.statusCode = 500;
    res.close();
  }
}