package App::ImapNotify::Socket::SSL; use v5.24; use strict; use warnings; use autodie; use Function::Parameters; use IO::Socket::SSL; use Log::Any qw($log); method new($class: $host, $port) { my $self = {}; $self->{config} = { host => $host, port => $port, }; bless $self, $class; return $self; } method reconnect() { $self->{sock} = IO::Socket::SSL->new("$self->{config}->{host}:$self->{config}->{port}"); } method readline() { return CORE::readline $self->{sock}; } method writeline($line) { print {$self->{sock}} $line; } 1; __END__