AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Indy 100% Auslastung
Thema durchsuchen
Ansicht
Themen-Optionen

Indy 100% Auslastung

Ein Thema von Gruber_Hans_12345 · begonnen am 15. Nov 2006 · letzter Beitrag vom 16. Nov 2006
Antwort Antwort
Gruber_Hans_12345

Registriert seit: 14. Aug 2004
1.426 Beiträge
 
Delphi 2007 Professional
 
#1

Indy 100% Auslastung

  Alt 15. Nov 2006, 14:12
Probiere gerade ein paar Sachen mit Indy aus

habe jetzt mal nur folgendes geschrieben (ein Form mit einem TIdTCPServer)

Delphi-Quellcode:
    IdTCPServer1.Bindings.Add.SetBinding('0.0.0.0', 5200);
    IdTCPServer1.Active := TRUE;
alles fein.

dann mache ich mal per Telnet eine Verbindung auf diesen Port (nur Connect, tippe noch nix) und der Server bekommt eine Auslastung von 100%.

Ist das normal, bzw. was mache ich da noch falsch?
Gruss Hans

2B or not 2B, that is FF
  Mit Zitat antworten Zitat
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#2

Re: Indy 100% Auslastung

  Alt 15. Nov 2006, 14:13
Wozu das Binding?
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat
Gruber_Hans_12345

Registriert seit: 14. Aug 2004
1.426 Beiträge
 
Delphi 2007 Professional
 
#3

Re: Indy 100% Auslastung

  Alt 15. Nov 2006, 14:19
weil der TIdTCPServer dynamisch zur Laufzeit erzeugt wird.
Gruss Hans

2B or not 2B, that is FF
  Mit Zitat antworten Zitat
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#4

Re: Indy 100% Auslastung

  Alt 15. Nov 2006, 14:35
Ja, aber wozu brauchst du das? Hast du einen Client mit IP 0.0.0.0?
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat
Gruber_Hans_12345

Registriert seit: 14. Aug 2004
1.426 Beiträge
 
Delphi 2007 Professional
 
#5

Re: Indy 100% Auslastung

  Alt 15. Nov 2006, 14:38
nein, 0.0.0.0 definiert ja nur, das auf allen verfügbaren ip Adressen gelauscht wird (zumindest kenne ich das so von den ics Komponenten - und vermute bei indy wirds gleich sein)
Gruss Hans

2B or not 2B, that is FF
  Mit Zitat antworten Zitat
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#6

Re: Indy 100% Auslastung

  Alt 15. Nov 2006, 14:55
Jedes "Binding" ist IIRC ein Client. Ich habe auch schon mit dynamisch erstellten IdTCPServern gearbeitet und habe noch nie diese Zuweisung gebraucht. Lass sie einfach mal weg und schau was passiert.

EDIT: Achja, und nicht vergessen nen Port zu setzen.
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat
Gruber_Hans_12345

Registriert seit: 14. Aug 2004
1.426 Beiträge
 
Delphi 2007 Professional
 
#7

Re: Indy 100% Auslastung

  Alt 15. Nov 2006, 15:02
auch wieder 100% CPU Last ... in beiden fällen bekommt Telnet ja ne Verbindung zusammen.

dachte Binding ist die Adresse/Port auf der der Server lauscht? (Und nicht ne Verbindung zum Client?)
Gruss Hans

2B or not 2B, that is FF
  Mit Zitat antworten Zitat
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#8

Re: Indy 100% Auslastung

  Alt 15. Nov 2006, 15:12
Das ist allerdings seltsam...
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat
Gruber_Hans_12345

Registriert seit: 14. Aug 2004
1.426 Beiträge
 
Delphi 2007 Professional
 
#9

Re: Indy 100% Auslastung

  Alt 16. Nov 2006, 09:48
habs schon ...

auf der Indy Seite (http://www.indyproject.org/Sockets/D...Indy10.de.aspx) gibts ne alte Version zum download (10.0.52) und genau die hab ich mir downgeloaded ... mit der neuen funkt es
Gruss Hans

2B or not 2B, that is FF
  Mit Zitat antworten Zitat
Benutzerbild von s.h.a.r.k
s.h.a.r.k

Registriert seit: 26. Mai 2004
3.159 Beiträge
 
#10

Re: Indy 100% Auslastung

  Alt 16. Nov 2006, 10:20
Das ganze liegt daran, dass du in der OnExecute-Procedure des TIdTCPServer den folgenden Befehl einfügen musst - der wohl bemerkt immer ausgeführt werden muss!!!):
Delphi-Quellcode:
procedure TTCPServer.IdTCPServerOnExecute(AContext: TIdContext);
begin
 
  // HIER KOMMT DEIN CODE BEI EINER ABFRAGE VOM CLIENT


  // Diese Zeile bitte belassen - gegen 100% CPU-Auslastung
  SleepEx(1, True);
end
»Remember, the future maintainer is the person you should be writing code for, not the compiler.« (Nick Hodges)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:17 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz