File: csink-ssl.e

package info (click to toggle)
entity 0.7.2-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,352 kB
  • ctags: 5,272
  • sloc: ansic: 61,707; sh: 7,921; makefile: 732; perl: 399
file content (52 lines) | stat: -rwxr-xr-x 942 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
40
41
42
43
44
45
46
47
48
49
50
51
52
<object default-lang="perl">
  <csink-ssl name="foo" remote-host="127.0.0.1" remote-port="8082"
  onnewdata="on_new_data" onclose="on_close" onconnect="on_connect"
  onerror="on_error"
  certfile="/net/home/jim/projects/entity/t/client.pem"
  certdir="/net/home/jim/projects/entity/t/"
  />
<?perl

sub on_connect
  {
    my $node = shift;

    print "we have connected\n";
    $node->attrib("_write" => "HI FROM SSL");
  }

sub on_new_data
  {
    my $node = shift;
    my $data = shift;
    my $length = shift;

    print "got data:\n";
    print "--$data--\n";

    
    #$node->attrib("_write" => $data);
  }

sub on_close
  {
    my $node = shift;

    print "bye!\n";
    #$node->call("entity:exit")
  }
  
sub on_error
  {
    my $node = shift;
    my $err = shift;

    print "we have received an error\n";
    print "$err\n";
  }

print "running\n";
$node = enode("csink-ssl.foo");
$node->attrib("action" => "connect");
?>
</object>