Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

NMHTTP Component Errors...

Posted on 1999-07-05
18
Medium Priority
?
482 Views
Last Modified: 2012-08-13
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.
0
Comment
Question by:dokken
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 7
  • 2
18 Comments
 

Author Comment

by:dokken
ID: 1386301
Edited text of question.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1386302
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.
0
 

Author Comment

by:dokken
ID: 1386303
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.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 13

Expert Comment

by:Epsylon
ID: 1386304
Quote from the docs:

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


This must be it.
0
 

Author Comment

by:dokken
ID: 1386305
That's not the exception that's the problem.
0
 
LVL 17

Expert Comment

by:inthe
ID: 1386306
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
0
 

Author Comment

by:dokken
ID: 1386307
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.
0
 
LVL 17

Expert Comment

by:inthe
ID: 1386308
Hi Dokken
aparently it is..although i wont say yes for sure as i dont know all the facts.

0
 

Author Comment

by:dokken
ID: 1386309
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..
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1386310
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.
0
 

Author Comment

by:dokken
ID: 1386311
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?
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1386312
Do you mean

OnPacketReceived := httpPacketRecvd;

Yhis sets the event like you usually do in the object inspector.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1386313
NMHttp1.OnPacketReceived := httpPacketRecvd;



0
 

Author Comment

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

Any ideas?
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1386315
The function should be declared as:

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

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



0
 

Author Comment

by:dokken
ID: 1386316
Cool, I had that part messed up.  Post something as an aswer so I can give you the points.
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 480 total points
ID: 1386317
Alright Dokken, thanks a lot.    :o)

Glad I could help you.
0
 

Author Comment

by:dokken
ID: 1386318
Thanks for the help :)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question