Advertisement
Guest User

Extended Payload (64bit) in mojolicious fails on 32 bit perl

a guest
May 2nd, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.12 KB | None | 0 0
  1.  
  2. use Mojolicious::Lite;
  3. use Mojo::IOLoop;
  4.  
  5. my $testpayload = '0123456789' x 165536;
  6.  
  7. get '/' => sub {
  8.     my $self = shift();
  9.     $self->render;
  10. } => 'index';
  11.  
  12. websocket '/websocket' => sub {
  13.     my $self = shift();
  14.     warn("Got connection\n");
  15.     $self->send({text => $testpayload});
  16. };
  17.  
  18. app->secret('BoxOfAssortedCreams');
  19. app->start;
  20.  
  21. __DATA__
  22.  
  23. @@ layouts/default.html.ep
  24. <!doctype html><html>
  25. <head>
  26. <title><%= title %></title>
  27. <script type="text/javascript">
  28. function wsobj() {
  29.  
  30.     var _self = this;
  31.     this.start = function() {
  32.  
  33.         var ws = new WebSocket('ws://' + document.location.host.toString() + '/websocket');
  34.  
  35.         ws.onclose = function(e) {
  36.             clearTimeout(_self.refresh);
  37.             setTimeout(_self.start, 2000);
  38.         }
  39.  
  40.         ws.onopen = function () {
  41.             console.log('WebSocket Connection Opened');
  42.         };
  43.  
  44.         ws.onmessage = function(evt) {
  45.             alert("Received " + evt.data.length + " bytes");
  46.         };
  47.     }
  48.  
  49.     _self.start();
  50.  
  51. }
  52.  
  53. new wsobj();
  54.  
  55. </script>
  56. </head>
  57. <body><%= content %></body>
  58. </html>
  59.  
  60. @@ index.html.ep
  61. % layout 'default';
  62. % title 'Large Payload Websocket Test';
  63. <h1>Large Payload Websocket Test</h1>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement