Autor Beitrag
Niels_
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 117



BeitragVerfasst: Sa 22.11.03 16:43 
Ich arbeite gerade an Netzwerk (versuche es gerade mit den Sockets von delphi). Wenn ich mein Programm starten lasse, hab ich jedoch ein Problem:
Mein Server kann ich createn.
Wenn ich dann aber sage, dass er bei Knopfdruck den clienten connecten soll krieg ich folgende Fehlermeldung:
"Projekt Projekt1 raised exception class ESocketError with message "Windows socket error: Es konnt ekeine Verbindgun hergestellt werden, da der Zielcomputer die Verbrindung verweigerte (10061), on API 'connect". Process stopped. (...)"
Hat jemand ne ahnung, was an meinem Source falsch ist? Oder muss ich die Sockets noch irgendwie definieren?
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
//Server createn
  ServerSocket1.Port:=200;
  ServerSocket1.active:=true;
  if Serversocket1.Socket.connected then label2.caption:='Online' else  label2.caption:='Offline';

//client connecten
   ClientSocket1.Host:='MyPC';
   ClientSocket1.Port:=200;
   clientsocket1.Active:=true;
   if clientsocket1.Socket.Connected then label3.caption:='Online' else label3.caption:='Offline';
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Sa 22.11.03 17:05 
Denk daran, dass wenn Client und Server auf ein und derselben Maschine laufen, verschiedene Ports zu benutzen sind, da sonst nur der erstgestartete Zugriff erhält.
grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
Niels_ Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 117



BeitragVerfasst: Sa 22.11.03 17:25 
Titel: Ups
Ups...
Okay, hab das geändert, krieg aber immernoch dieselbe Fehlermeldung?!
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Sa 22.11.03 18:59 
Wenn Client und Server unterschiedliche Ports benutzen, wirst du nie verbinden können, weil sie sich nicht finden können.

Läuft bei dir evtl. eine Firewall?

_________________
If accidentally read, induce vomitting.
Niels_ Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 117



BeitragVerfasst: Sa 22.11.03 19:08 
Titel: Ports und Firewall
Okay - hab also wieder den selben Port!

Nee - hab keine Firewall aktiviert!
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Sa 22.11.03 19:10 
Das ist merkwürdig. Bei mir funktioniert der Codeausschnitt.
Hast du vielleicht Irgendetwas im Objektinspektor für Server- und Clientsocket verstellt?

_________________
If accidentally read, induce vomitting.
Niels_ Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 117



BeitragVerfasst: Sa 22.11.03 19:36 
Titel: Alles wie sonst
Nee - hab ich nicht!
Hab selbe Problem bei Verbindungen mit indy komponente (idTCPclient & Server). Da meckert er immer über irgendeinen Socket?!
Hammer nervig! Hab ein Tool gefunden, dass mir sagt, dass alle meine Ports geschlossen sind?! Aber ich hab 100pro keine Firewall aktiviert! Komisch, komisch...!

Weiß nicht jemand was da los ist??!!
Niels_ Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 117



BeitragVerfasst: Sa 22.11.03 19:43 
Titel: Noch mehr komisches...
Hab herausgefunden, dass alle meine Indy-Clients nicht funken! Immer meldet er: "Socket Error #10061 Connection refused" - ich find das echt nervig...