Networking Forums

Networking Forums > Computer Networking > Linux Networking > getting problem to write SSL server

Reply
Thread Tools Display Modes

getting problem to write SSL server

 
 
Rushikesh Joshi
Guest
Posts: n/a

 
      12-12-2003, 04:37 AM
Hi All

I have successfully install the openssl on my Redhet linux7 System.
I also able to run "SSL Server" and "SSL Client" on same.
All is going fine but i am having problem on ssl_server.pl file.

Code:
#SSL Server Data receive loop
while (1) {
warn "waiting for next connection.\n";

while(($s = $sock->accept())) {
my ($peer_cert, $subject_name, $issuer_name, $date, $str);

if( ! $s ) {
warn "error: ", $sock->errstr, "\n";
next;
}

warn "connection opened ($s).\n";

if( ref($sock) eq "IO::Socket::SSL") {
$subject_name = $s->peer_certificate("subject");
$issuer_name = $s->peer_certificate("issuer");
}

warn "\t subject: '$subject_name'.\n";
warn "\t issuer: '$issuer_name'.\n";

#My change code *******************************

$temp_off=1;
$temp_off=1;
while ($s->peek($temp_r,75,$temp_off))
{
warn "\n waiting for data. \n";
print "\n Incomming Message: ";
print $temp_r; #This line print incoming data
#$temp_r="";
#print "\n Length: $temp_size \t Offset: $temp_off";
$temp_off=$temp_off+length($temp_r);
}
#End my change code ***************************

my $date = localtime();
print $s "my date command says it's: '$date'";
close($s);
warn "\t connection closed.\n";
}
}
#End SSL Server Data Receive Loop

Problem:
I have a problem that when my ssl_server's socket receive the data
from client the data displays but
in that while loop just it while loop it just goingon and cant break
from that loop.

I know there is only some logical error in my code. I aslo set the
increment of OffSet by the size of
data but no any result come.

See above code the Print $temp_r function print the received data.
after once data received the cursor doesn't break the loop.

I don't know weather i have to use the thread or some else.

Any idea or small code/tips how to write server.

Thanks in advance.


Regards
Rushi
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write-only share on Windows Server 2003 SP2 jqq Windows Networking 0 11-14-2007 06:14 PM
ex3 share write problem with samba 7 Linux Networking 2 08-22-2004 08:21 PM
Random Write errors in Win2003 server - From WMencoder Avicencio Windows Networking 0 07-21-2004 08:02 PM
Delayed write failed on Windows 2003 server Robert DAMIAS Windows Networking 0 05-19-2004 06:42 AM
NFS problem: can't write or access index.php Nick E. Linux Networking 0 03-03-2004 12:04 PM



1 2 3 4 5 6 7 8 9 10 11