Thread Hilfe bei Code analyse (5 answers)
Opened by stefan at 2010-09-06 21:42

Gast stefan
 2010-09-07 07:06
#141233 #141233
Hallo,
Das habe ich natürlich nicht mit absicht gemacht. Aber es gibt eine Maximallänge der Postings....

Also bei send_msg werden folgende use verwendet:
Code (perl): (dl )
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
use strict;
use warnings;

# Add the modules to the libpath
use FindBin;
use lib "$FindBin::Bin/../src/Net-UDAP/lib";
use version; our $VERSION = qv('1.0_01');
use vars qw( $AUTOLOAD );    # Keep 'use strict' happy
use base qw(Class::Accessor);

use Carp;
use Data::Dumper;
use Data::HexDump;
use IO::Select;
use IO::Socket::INET;
use Net::UDAP::Client;
use Net::UDAP::Constant;
use Net::UDAP::Log;
use Net::UDAP::MessageIn;
use Net::UDAP::MessageOut;
use Net::UDAP::Util;
use Time::HiRes;

my %field_default = (
    socket      => undef,
    device_hash => undef,    # store devices in a hash ref
    local_ips   => undef,    # hash ref of local IPs
);

__PACKAGE__->mk_accessors( keys %field_default );


und bei messageout folgende:
Code (perl): (dl )
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
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../src/Net-UDAP/lib";
use version; our $VERSION = qv('1.0_01');
use vars qw( $AUTOLOAD );    # Keep 'use strict' happy
use base qw(Class::Accessor);
use Carp;
use Data::Dumper;
use Data::HexDump;
use Net::UDAP::Constant;
use Net::UDAP::Log;
use Net::UDAP::Util;

my %fields_default = (

    # define fields and default values here
    dst_broadcast => BROADCAST_OFF,
    dst_type      => DST_TYPE_ETH,
    dst_mac       => undef,
    src_broadcast => BROADCAST_OFF,
    src_type      => ADDR_TYPE_UDP,
    src_ip        => IP_ZERO,
    src_port      => PORT_ZERO,
    seq           => pack( 'n', 0x0001 ),        # unused
    udap_type     => UDAP_TYPE_UCP,
    ucp_flags     => pack( 'C', 0x01 ),          # unused?
    ucp_class     => UAP_CLASS_UCP,
    ucp_method    => undef,
    credentials   => pack( 'C32', 0x00 x 32 ),
    data_to_get => undef,  # store data to get as an anon array of param names
    data_to_set => undef,  # store data to set as an anon hash
);

__PACKAGE__->mk_accessors( keys(%fields_default) );

Last edited: 2010-09-07 07:12:03 +0200 (CEST)

View full thread Hilfe bei Code analyse