Einzelnen Beitrag anzeigen

Benutzerbild von Captnemo
Captnemo

Registriert seit: 27. Jan 2003
Ort: Bodenwerder
1.126 Beiträge
 
Delphi XE4 Architect
 
#1

ICS TWSocket Eingehende Verbindung

  Alt 16. Jun 2014, 11:58
Hi,

ich versuche mich gerade mit den ICS-Komponenten. Explizit eine Eingehende Verbindung per TCP über TWSocket.
Laut Wiki soll ich im Event "SessionAvailable" folgendes machen:
Zitat:
The following example implements the OnSessionAvailable of a simple TCP-Server which transfers the accepted connection to another socket so that other incomming connections can be accepted as well. Since the socket the connection is transfered to is a global variable here only one connection can be accepted, but this example is simply for showing the basics.
var socket:TMySocket; // a descendant of TWSocket with overwritten OnDataAvailable

Delphi-Quellcode:
 procedure TMyServer.MyOnSessionAvailable(Sender: TObject; ErrCode: Word);
 var NewS:TSocket;
 begin
   if ErrCode <> 0 then exit;
 
   NewS:=Accept;
   socket:=TMySocket.create(nil);
   socket.dup(NewS);
 end;
Ich finde nur in XE4 nirgends die Klasse TSocket. Kann mir jemand auf die Sprünge helfen?
Dieter
9 von 10 Stimmen in meinem Kopf sagen ich bin nicht verrückt. Die 10. summt dazu die Melodie von Supermario Bros.
MfG Captnemo
  Mit Zitat antworten Zitat