B2G/gecko/dom/network/tests/unit/test_tcpsocket.js
/**
 * Send a large amount of data and immediately call close
 */
Send a large amount of data and immediately call close
Send a large amount of data and immediately call close
function bufferedClose() {
  var yays = makeJointSuccess(['serverdata', 'clientclose', 'serverclose']);
  server.ondata = makeExpectData(
    "ondata", BIG_TYPED_ARRAY, false, yays.serverdata);
  server.onclose = yays.serverclose;
  sock.onclose = yays.clientclose;
  sock.send(BIG_ARRAY_BUFFER);
  sock.close();
}
function bufferedClose ( ) { var yays = makeJointSuccess ( [ 'serverdata' , 'clientclose' , 'serverclose' ] ) ; server . ondata = makeExpectData ( "ondata" , BIG_TYPED_ARRAY , false , yays . serverdata ) ; server . onclose = yays . serverclose ; sock . onclose = yays . clientclose ; sock . send ( BIG_ARRAY_BUFFER ) ; sock . close ( ) ; }
Send a large amount of data and immediately call close
Send a large amount of data and immediately call close