Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

port 25 on windows XP

by Anonymous Monk
on Jun 17, 2005 at 02:12 UTC ( [id://467530]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

The following server and client don't talk, but if I change the port numbers, they just become fine. I wonder whether there is something special with port 25 on windows XP. I know it is for smtp and that's the purpose. if I stop my server, netstat -a shows nothing listening on that port, so the port is available.

server

use warnings; use strict; use IO::Socket::INET; my $server = new IO::Socket::INET(Proto => "tcp", LocalAddr => "localhost", LocalPort => 25, Listen => 10) || die "Failed to initialize socket\n"; print "Socket initlaized\n"; my $connection = $server->accept(); print "connect\n"; while (<$connection>) { print $_; }

client

use warnings; use strict; use IO::Socket::INET; my $server = new IO::Socket::INET(Proto => "tcp", PeerAddr => "localhost", PeerPort =>25);

Replies are listed 'Best First'.
Re: port 25 on windows XP
by shenme (Priest) on Jun 17, 2005 at 06:23 UTC
    I didn't get any reaction from sh1tn's variation on your code, until I changed the port to 4025, as you described. I checked the various settings under Control Panel / Windows Firewall and didn't see anything pertinent.

    Then I thought about my running Norton Antivirus with Email scanning active. I went into NAV and turned off email scanning (Options / Email). And gee, the code started working! Turned email scanning back on and your code stopped working.

    Do you by any chance have Norton Antivirus or some similar antivirus software running on your Windows XP?

Re: port 25 on windows XP
by BrowserUk (Patriarch) on Jun 17, 2005 at 03:07 UTC

    You don't say which other port values work, but is this a permissions thing?

    I have a vague recollection that non-admistrators require addition privaledges to be assigned before they can run tcp servers on the reserved port (0 .. 1023).

    It could also be related to which service pack you are running--permission required for various things tcp related change dramatically for non-admin accounts if you've installed SP2.

    Are you running a firewall? What if anything is showing up in the logs?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

      This would be the most likely cause if you have installed SP2. The builtin windows firewall is turned on by default under XP SP2. You can either exclude port 25 or turn the firewall off all together under Control Panel -> "Windows Firewall"


      Thanks,
      Greg W

      fine with admin

Re: port 25 on windows XP
by monarch (Priest) on Jun 17, 2005 at 02:31 UTC
    Does the client talk to the server if both are on the same PC?

    Either way I think the problem is an XP one, not a Perl one..

      Very sound reasoning that this is not a Perl question. That's the only bright spot of this answer ;-)

Re: port 25 on windows XP
by sh1tn (Priest) on Jun 17, 2005 at 02:50 UTC
    Maybe you mean this:
    # SERVER use warnings; use strict; use IO::Socket; $|++; my $server = new IO::Socket::INET(Proto => "tcp", LocalAddr => "localhost", LocalPort => 25, Listen => 10) || die "Failed to initialize socket\n"; while (my $connection = $server->accept()) { print "client's saying - ", $_ = <$connection>; print $connection "I've got your $_"; close($connection); } __END__ # CLIENT use warnings; use strict; use IO::Socket; $|++; my $server = new IO::Socket::INET(Proto => "tcp", PeerAddr => "localhost", PeerPort =>25); print $server $_ = localtime().$/; print "server's saying $_" while <$server>; close($server) __END__


      DOn't know what you are talking, but thanks for your good will.

Re: port 25 on windows XP
by Anonymous Monk on Jun 19, 2005 at 17:18 UTC

    resolved, two things: 1) zone alerm; 2) admin.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://467530]
Approved by moot
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found