| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Lab::Connection::Socket; |
|
2
|
|
|
|
|
|
|
#ABSTRACT: IP socket connection |
|
3
|
|
|
|
|
|
|
$Lab::Connection::Socket::VERSION = '3.880'; |
|
4
|
1
|
|
|
1
|
|
1945
|
use v5.20; |
|
|
1
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
13
|
use Lab::Bus::Socket; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
33
|
|
|
7
|
1
|
|
|
1
|
|
7
|
use Lab::Connection; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
21
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use Lab::Exception; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
277
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @ISA = ("Lab::Connection"); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our %fields = ( |
|
13
|
|
|
|
|
|
|
bus_class => 'Lab::Bus::Socket', |
|
14
|
|
|
|
|
|
|
wait_status => 0, # usec; |
|
15
|
|
|
|
|
|
|
wait_query => 10e-6, # sec; |
|
16
|
|
|
|
|
|
|
read_length => 1000, # bytes |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
|
20
|
0
|
|
|
0
|
1
|
|
my $proto = shift; |
|
21
|
0
|
|
0
|
|
|
|
my $class = ref($proto) || $proto; |
|
22
|
0
|
|
|
|
|
|
my $twin = undef; |
|
23
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(@_) |
|
24
|
|
|
|
|
|
|
; # getting fields and _permitted from parent class |
|
25
|
0
|
|
|
|
|
|
$self->${ \( __PACKAGE__ . '::_construct' ) }(__PACKAGE__); |
|
|
0
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return $self; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
#---For compatibility with Instruments written for GPIB---- |
|
31
|
|
|
|
|
|
|
sub EnableTermChar { # 0/1 off/on |
|
32
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
33
|
0
|
|
|
|
|
|
my $enable = shift; |
|
34
|
0
|
|
|
|
|
|
print "EnableTermChar Ignored: Only for GPIB not for SOCKET?\n"; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#$self->{'TermChar'}=$enable;#bus()->connection_enabletermchar($self->connection_handle(), $enable);} |
|
37
|
0
|
|
|
|
|
|
return 1; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub SetTermChar { # the character as string |
|
41
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
42
|
0
|
|
|
|
|
|
my $termchar = shift; |
|
43
|
0
|
|
|
|
|
|
print "SetTermChar Ignored: Only for GPIB not for SOCKET?\n"; |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#my $result=$self->bus()->connection_settermchar($self->connection_handle(), $termchar); |
|
46
|
0
|
|
|
|
|
|
return 1; |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=pod |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=encoding UTF-8 |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 NAME |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Lab::Connection::Socket - IP socket connection |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 VERSION |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
version 3.880 |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Copyright 2012 David Kalok |
|
70
|
|
|
|
|
|
|
2013 Andreas K. Huettel |
|
71
|
|
|
|
|
|
|
2016 Simon Reinhardt |
|
72
|
|
|
|
|
|
|
2017 Andreas K. Huettel |
|
73
|
|
|
|
|
|
|
2020 Andreas K. Huettel |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
77
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |