I have written a socket connected - works fine. connects.
I am trying to pull in multiple characters (like a username) but the code just lets me type 1 character at a time. Any info or links are appreciated.
Relevant Code attached.
Code:
while(1)
{
# waiting for a new client connection
my $client_socket = $socket->accept();
my $response = "";
# get information about a newly connected client
my $client_address = $client_socket->peerhost();
my $client_port = $client_socket->peerport();
print "connection from $client_address:$client_port\n";
#send connect banner
$client_socket->send($connect_banner);
sleep(1);
#$client_socket->send($ansi_graphics);
#$response = $client_socket->recv($response, 2);
if ($response == 1) {
#ANSI
#$client_socket->send("ANSI Selected" . $reset);
}
if ($response == 2) {
#NOANSI
}
$client_socket->send($login_firstname);
$client_socket->recv($response, 1024);
$client_socket->send($login_lastname);
$client_socket->recv($response, 1024);
client_socket->recv will only receive one character at a time.. then goes to next prompt.
Thanks.
-cadams