Sponsored Content
Top Forums Programming Socket Programming - Port Scanner. I Get Connection Timed Out, Why? Post 302252025 by f.ben.isaac on Tuesday 28th of October 2008 03:52:44 PM
Old 10-28-2008
Quote:
Well, perhaps there's a firewall (or at least IP packet filter) dropping the packets.
You are right. This port scanner is made so simple, not stealthy & does not pass any firewall. Otherwise, it should scan normally.

It works best if you use it in your network internally, or use against your machine.

I opened a port from terminal by doing

sudo nc -l -p AnyPortNumber

Then tested the program, It worked!

Note - Instead of doing this

struct sockaddr_in *specifyPort = (struct sockaddr_in *)results->ai_addr;
specifyPort->sin_port = htons(startingPort);

Do this,

status = getaddrinfo(remoteIP, startingPort , &hints, &results);


Better & easier.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Connection Timed out

I connect to a Sun Box through telnet but it timed out in couple of minutes. Advance thanks for any idea...help... (2 Replies)
Discussion started by: s_aamir
2 Replies

2. UNIX for Advanced & Expert Users

deferred: connection timed out with NT

We recently installed a new release of SCO UNIX (5.0.6) and when I try to relay e-mail from the UNIX box to my NT server (the mail server) I get the following message from sendmail. Deferred: Connection timed out with nt I have nt set up as my relay server in sendmail.cf and the mail seems to... (8 Replies)
Discussion started by: jmossman
8 Replies

3. UNIX for Advanced & Expert Users

TCP port scanner for remote or for local

I am unable to find any TCP scanner for data captruing for a Remote or local server. Can anybody please help. i need it to read TCP port and capture the incoming/outgoing data , (3 Replies)
Discussion started by: fahadsiddiqui
3 Replies

4. Linux Benchmarks

Connection Timed out problem - EM64T

Hai All, I have problem during HTTP benchmarking with polygraph tool on EM64T machine. Benchmarking results are getting problem bcas of connection timed out system errors. Machine log information is as, /var/log/messages.3:Feb 18 16:17:44 proxy64 network: Bringing up interface eth0: ... (0 Replies)
Discussion started by: muthukumar
0 Replies

5. HP-UX

connection timed out

I am trying to connect with my hp machine using "dialup networking." It times out after 30 seconds. Is there a way to adjust this time. Would it have anything to do with rexec? thanks (0 Replies)
Discussion started by: paschal
0 Replies

6. UNIX for Dummies Questions & Answers

Socket programming:One server two port

I want my server socket to listen on two ports in my machine. How do i achieve it? I will have two clients one connecting to 1 port and another to a different port. So my server needs to listen to both. Thanks. (1 Reply)
Discussion started by: abc.working
1 Replies

7. Programming

Cloning a socket connection, using other port numbers

Hello everybody, I've coded a multi-client server based on internet sockets using the scheme listen on port X-accept-fork, exactly like beej's guide At some point I would like to establish a secondary connection between a client and the server-child serving him. I was considering the... (4 Replies)
Discussion started by: jonas.gabriel
4 Replies

8. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

9. Programming

socket programming using UDP connection

I want to send packets through single socket() but using two different port numbers in UDP. Anybody give some idea on this. Thanks in advance.:) (2 Replies)
Discussion started by: naresh046
2 Replies

10. AIX

Ssh connection timed out

Hello, I have two AIX6.1 machines that can communicate with each other through ssh. The problem is that one of them somehow closes the connection after some time and i don't know the reason of that. For example today i send through rsync command 7 files from one server to the other. It send... (7 Replies)
Discussion started by: omonoiatis9
7 Replies
POE::Component::Connection::Keepalive(3pm)		User Contributed Perl Documentation		POE::Component::Connection::Keepalive(3pm)

NAME
POE::Component::Connection::Keepalive - a wheel wrapper around a kept-alive socket VERSION
version 0.271 SYNOPSIS
See the SYNOPSIS for POE::Component::Client::Keepalive for a complete working example. my $connection = $response->{connection}; $heap->{connection} = $connection; $connection->start( InputEvent => "got_input" ); delete $heap->{connection}; # When done with it. DESCRIPTION
POE::Component::Connection::Keepalive is a helper class for POE::Component::Client::Keepalive. It wraps managed sockets, providing a few extra features. Connection objects free their underlying sockets when they are DESTROYed. This eliminates the need to explicitly free sockets when you are done with them. Connection objects manage POE::Wheel::ReadWrite objects internally, saving a bit of effort. new Creates a new POE::Component::Connection::Keepalive instance. It accepts two parameters: A socket handle (socket) and a reference to a POE::Component::Client::Keepalive object to manage the socket when the connection is destroyed. my $conn = POE::Component::Connection::Keepalive->new( socket => $socket_handle, manager => $poe_component_client_keepalive, ); new() is usually called by a POE::Component::Client::Keepalive object. start Starts a POE::Wheel::ReadWrite object. All parameters except Handle for start() are passed directly to POE::Wheel::ReadWrite's constructor. Handle is provided by the connection object. start() returns a reference to the new POE::Wheel::ReadWrite object, but it is not necessary to save a copy of that wheel. The connection object keeps a copy of the reference internally, so the wheel will persist as long as the connection does. The POE::Wheel::ReadWrite object will be DESTROYed when the connection object is. # Asynchronous connection from Client::Keepalive. sub handle_connection { my $connection_info = $_[ARG0]; $_[HEAP]->{connection} = $connection_info->{connection}; $heap->{connection}->start( InputEvent => "got_input", ErrorEvent => "got_error", ); } # Stop the connection (and the wheel) when an error occurs. sub handle_error { delete $_[HEAP]->{connection}; } wheel Returns a reference to the internal POE::Wheel::ReadWrite object, so that methods may be called upon it. $heap->{connection}->wheel()->pause_input(); close Closes the connection immediately. Calls shutdown_input() and shutdown_output() on the wheel also. SEE ALSO
POE POE::Component::Client::Keepalive POE::Wheel::ReadWrite BUGS
None known. LICENSE
This distribution is copyright 2004-2009 by Rocco Caputo. All rights are reserved. This distribution is free software; you may redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Rocco Caputo <rcaputo@cpan.org> Special thanks to Rob Bloodgood. perl v5.14.2 2012-05-15 POE::Component::Connection::Keepalive(3pm)
All times are GMT -4. The time now is 02:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy