Advertisement
Guest User

Untitled

a guest
Sep 7th, 2011
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.74 KB | None | 0 0
  1. sub webleg{
  2.    
  3.     my $self = shift;
  4.    
  5.     print "Client connected\n";
  6.  
  7.     my $user = $self->session('login');
  8.     my $connection = $self->tx->connection;
  9.     if($self->tx->is_websocket)
  10.     {
  11.     print "this is a websocket transaction\n";}
  12.    
  13.     $self->send_message( "Congratulations $user, your Mojo is working your connect id is $connection !");
  14.     my $tx = $self->tx->connection($connection);
  15.    
  16.     if($tx->is_websocket){
  17.     print "The returned transaction is a websocket\n";
  18.     }else
  19.     {print "The returned transaction is not a websocket\n";}
  20.  
  21. }
  22.  
  23. output:
  24. Client connected
  25. this is a websocket transaction
  26. The returned transaction is not a websocket
  27.  
  28.  
  29. Shouldn't the returned transaction be a websocket class?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement