Link to home
Start Free TrialLog in
Avatar of dokken
dokken

asked on

NMHTTP Component Errors...

I'm using the HTTP component that came with Delphi 4.0 and I have it getting information from various places on the web in a loop using the .get.  I also have a timer setup so if there's no activity for 30 seconds between packets received it abort... using .abort and move on to the next site.  The problem I'm having is, after it aborts I get an error when trying to connect to the next one... this is the error: "ESockError 10038: Socket Operation On Non-Socket".  Does anyone what I can do to stop getting that error on aborts?

Thanks.
Avatar of dokken
dokken

ASKER

Edited text of question.
Does re-assigning all properties not work? In particlar the Port property. Did you try to catch the OnFailureEvent? By the way TNMHTTP has a build-in Timeout property.

In my opinion the Netmaster components are not very stable. What you could do is get the upgrade at:

http://www.netmastersllc.com/home/

Costs nothing but you have to register.
Or use this well known freeware comonent:

http://www.rtfm.be/fpiette/httpcliuk.htm


Regards,

Epsylon.
Avatar of dokken

ASKER

I was thinking maybe it's not correctly aborting due to a bug or something else.  I know the component has a time out property but it only seems to work for connecting to the site, not waiting for the packets to be received.  I'll try out the upgrade... otherwise I was using the fpeitte one but it has a big bug in it that was causing it to get stuck in a loop when it was trying to receive data. So I switched to the Delphi one.

If the upgrade one works I'll give you the points.
Quote from the docs:

When an abort occurs, an exception is raised, and the current operation is canceled.


This must be it.
Avatar of dokken

ASKER

That's not the exception that's the problem.
another internet componnet suite that is very well supported is winshoes:

http://www.pbe.com/SourceWorks/Winshoes/

maybe try them if no success elsewhere
if you ever need any help with winshoes the authors all hang out at the following newsgroup and are very helpful:
 borland.public.delphi.internet
Regards Barry
Avatar of dokken

ASKER

Barry,

I wonder if that thing they wrote about NetMasters is true.  I'm going to download their version of it and see what happens since the NetMasters upgrade didn't fix it.
Hi Dokken
aparently it is..although i wont say yes for sure as i dont know all the facts.

Avatar of dokken

ASKER

The Winshoes is causing the same error.  The NetMasters one works though if I create it and free it each time.  I'll give the points to anyone who can tell me how I access the events like OnPacketRecvd when the component is create and free'd this way..
I HAVE GOT IT !!!!!

This must be worth an 'A'   :o)

use this:


  try
    NMHTTP1.Get(Edit1.Text);
  except
    ShowMessage('Get failed :o(');
  end;


Epsylon.
Avatar of dokken

ASKER

You must have misread the message.  That part I know.  The part I don't know, since I don't have the component on the form anymore, is the events.  I'm creating the component each time I want to connect to a web site and freeing it after each time.  Since I'm doing it this way to avoid the error I was getting the events don't work.  I used to use: procedure TForm1.httpPacketRecvd(Cmd: CmdType); but now the components not on the form and I still want to access that so I can show the bytes being received.

How can I do that?
Do you mean

OnPacketReceived := httpPacketRecvd;

Yhis sets the event like you usually do in the object inspector.
NMHttp1.OnPacketReceived := httpPacketRecvd;



Avatar of dokken

ASKER

It's giving me an error: Incompatible types: method pointer and regular expression.

Any ideas?
The function should be declared as:

type
  TForm1 = class(TForm)
    ...
    procedure NMHTTP1PacketRecvd(Sender: TObject);
    ...
  end;
     

TForm1.NMHTTP1PacketRecvd(Sender: TObject);
begin
  ....
end;



Avatar of dokken

ASKER

Cool, I had that part messed up.  Post something as an aswer so I can give you the points.
ASKER CERTIFIED SOLUTION
Avatar of Epsylon
Epsylon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dokken

ASKER

Thanks for the help :)