B2G/gecko/dom/network/tests/unit/test_tcpsocket.js
/**
 * Connect the socket to the server. This test is added as the first
 * test, and is also added after every test which results in the socket
 * being closed.
 */
Connect the socket to the server. This test is added as the first
test, and is also added after every test which results in the socket
being closed.
Connect the socket to the server . This test is added as the first test and is also added after every test which results in the socket being closed .
function connectSock() {
  server.reset();
  var yayFuncs = makeJointSuccess(['serveropen', 'clientopen']);
  sock = TCPSocket.open(
    '127.0.0.1', server.listener.port,
    { binaryType: 'arraybuffer' });
  sock.onopen = yayFuncs.clientopen;
  sock.ondrain = null;
  sock.ondata = makeFailureCase('data');
  sock.onerror = makeFailureCase('error');
  sock.onclose = makeFailureCase('close');
  server.onaccept = yayFuncs.serveropen;
  server.ondata = makeFailureCase('serverdata');
  server.onclose = makeFailureCase('serverclose');
}
function connectSock ( ) { server . reset ( ) ; var yayFuncs = makeJointSuccess ( [ 'serveropen' , 'clientopen' ] ) ; sock = TCPSocket . open ( '127.0.0.1' , server . listener . port , { binaryType : 'arraybuffer' } ) ; sock . onopen = yayFuncs . clientopen ; sock . ondrain = null ; sock . ondata = makeFailureCase ( 'data' ) ; sock . onerror = makeFailureCase ( 'error' ) ; sock . onclose = makeFailureCase ( 'close' ) ; server . onaccept = yayFuncs . serveropen ; server . ondata = makeFailureCase ( 'serverdata' ) ; server . onclose = makeFailureCase ( 'serverclose' ) ; }
Connect the socket to the server.
Connect the socket to the server .