File: csink-ssl-server.e

package info (click to toggle)
entity 1.0.1-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,604 kB
  • ctags: 5,394
  • sloc: ansic: 64,242; sh: 7,377; makefile: 776; perl: 319
file content (39 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<object default-lang="perl">
  <csink-ssl name="foo" local-port="8081"
   onnewdata="on_new_data"
   onconnect="on_connect"
   onerror="on_error"
   certfile="/net/home/jim/projects/entity/t/server.pem"
   certdir="/net/home/jim/projects/entity/t/"
   />
<?perl
sub on_connect
  {
    my $node = shift;
    print "we have connected\n";
    $node->attrib("_write" => "hi\n\n");
  }

sub on_new_data
  {
    my $node = shift;
    my $data = shift;
    my $length = shift;
    print "data = \n";
    print "$data\n";
    $node->attrib("action" => "close");
  }

sub on_error
  {
    my $node = shift;
    my $err = shift;
    print "we have received an error\n";
    print "$err\n";
  }

print "blah";
$node = enode("csink-ssl.foo");
$node->attrib("action" => "listen");
?>
</object>