I am in the process of writing a server that will accept an xml file, parse it, then send a response back based on the file.
I have successfully written the Server and a mock Client in Perl which communicate wonderfully through a tcp connection on port 80. The problem is, when the actual client connects using their client app, it passes a POST header which the server takes in but it stops responding when the xml data is passed.
At this point I want to take in all the information from the client request. I have a packet sniffer open and it's showing me the POST request which the server accepts and writes. After that, the sniffer shows a continuation which holds the XML data from the client. The server stops after printing the Header POST, and no XML is printed.
use IO::Socket;
$local = IO::Socket::INET->new(
Proto => 'tcp',
LocalAddr => '192.168.150.131:80', Reuse => 1
) or die "$!";
$local->listen();
print "Awaiting client...\n";
my $addr;
while ($addr = $local->accept() ) {
print "Connecting from: ", $addr->peerhost();
print " Port: ", $addr->peerport(), "\n";
while (<$addr>) {
print "Client: $_";
}
close $addr; # close client
print "Idle...\n";
}
Any suggestions would be greatly appreciated.
Thank you,
DWW
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.