[prev in list] [next in list] [prev in thread] [next in thread] 

List:       twsocket
Subject:    Re: [twsocket] Working on a "portscanner"
From:       Merijn Terheggen <merijn () gmail ! com>
Date:       2005-02-23 22:56:12
Message-ID: ca37cd84050223145631e950aa () mail ! gmail ! com
[Download RAW message or body]

Not exactly sure what you're looking for. Go through all the ICS
examples and try to understand what the code is doing. Not only the
socket stuff but also other ones because many of them use basic
programming structures you could use very well (how to create your own
event handlers and let them process the data that is generated etc).
It's a great way of learning many basics of how to do stuff and also
about how to do it in Delphi/Builder.

You mention a loop. Some basics if you want to work from within a loop:
- Include a 'Sleep(10)' for instance to let the loop sleep for 10
millisecs to not eat away 100% precessor power with just the waiting
loop.
- Include an 'Application->ProcessMessage() in the loop so that events
will be processed and your event handlers can respond.
- Don't use the 'Application->ProcessMessages()' from within an event
handler. It will mess up things.

Good luck.

--M

On Wed, 23 Feb 2005 23:19:18 +0100, AciD rOx <acid.rox@gmail.com> wrote:
> No one replied so i will try again.
> Could some one past a snippet or somekind of hint so i can make this work ?
> 
> 
> On Mon, 21 Feb 2005 12:02:20 +0100, AciD rOx <acid.rox@gmail.com> wrote:
> > Francois, Wilfried,  could u plz give me some kinda hint here, i have
> > no idea how to do that...
> > As i said in the first post, im kinda new to all of this.
> >
> > (not sure if this is going to be a double post, if so, im sorry)
> >
> >
> > On Mon, 21 Feb 2005 11:07:48 +0100, Wilfried Mestdagh
> > <wilfried@mestdagh.biz> wrote:
> > > Hello Anders,
> > >
> > > > but i just can figure out how to do the loop
> > >
> > > Thats the advantage with TWSocket. You dont need a loop because TWSocet
> > > is event driven. You call connect and then your code end. A while later
> > > OnSessionConnected is called with or without winsock error. Depending on
> > > the winsock error you know if there is a listening port or not. It is in
> > > that event you take next action. For a port scanner, you disconnect over
> > > there. Then your code ends. A while later OnSessionClosed is called.
> > > There you take next action. For a port scanner you connect to next port
> > > and your code ends there again.
> > >
> > > Make a custom message handler to do the connection, for the close use
> > > CloseDelayed, and to make it fast you can create a certain amount of
> > > TWSocket wich operate simultanously. You can use same event handlers for
> > > each TWSocket because Sender argument is the component itself.
> > >
> > > ---
> > > Rgds, Wilfried
> > > http://www.mestdagh.biz
> > >
> > > Monday, February 21, 2005, 07:31, AciD rOx wrote:
> > >
> > > > Francois PIETTE was so kindful to help me on the Borland newsgroups
> > > > and directed me to this email-list. Anyways, started working on a
> > > > portscanner, but i used the clientsocket, wich seemed like a bad idea.
> > > > Francois, told me to use the Wsocket instead, but i just can figure
> > > > out how to do the loop ? So could some one plz give me a hint, example
> > > > etc. (yes im aware this proberly is a easy thing to do, but im kinda
> > > > new  to programming)
> > >
> > > > Regards
> > > > Anders
> > >
> > > --
> > > To unsubscribe or change your settings for TWSocket mailing list
> > > please goto http://www.elists.org/mailman/listinfo/twsocket
> > > Visit our website at http://www.overbyte.be
> > >
> >
> 
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic