package mojo::Client::SMSsendx;
use IO::Socket::INET;
use Data::Dumper;
use Encode;
sub SMSsendx {
$|=1;
$sock = IO::Socket::INET->new(PeerAddr => '10.3.229.1',
PeerPort => '745',
Proto=>'tcp'
) or die "$!
";
my $self=shift;
my $message=shift;
my $phone=shift;
print "sock$message is $message
";
my $tab=chr(9);
#my $data=0Xd$tab;
my $data=chr(28).chr(48).chr(88).chr(100)."$tab";
$data .="015802$tab";
$data .="$tab";
$data .="N$tab";
$data .="$message$tab";
$data .="$phone$tab";
print "-----------------
";
print $data."
";
print "-----------------
";
# data to send to a server
my $req = "$data";
my $size = $sock->send($req);
print "sent data of length $size
";
# # notify server that request has been sent
shutdown($sock, 1);
# # receive a response of up to 1024 characters from server
my $response = "";
$sock->recv($response, 1024);
print "received response: $response
";
$sock->close();
};
1;