Einzelnen Beitrag anzeigen

Beckman

Registriert seit: 12. Jul 2004
205 Beiträge
 
#6

Re: console application --> events --> clientsocket pr

  Alt 16. Aug 2004, 01:54
dann muesste es ja fast so gehen:

Code:
procedure Connect();
begin
writeln('connect() executed!');
  if (Client = nil) or (Event = nil) then
        begin
        Event := TEvent.Create;
        writeln('event created');

        Client := TClientSocket.Create(nil);
        writeln('client created');

        Client.OnConnect := Event.ClientConnect;
        Client.OnConnecting := Event.ClientConnecting;
        Client.OnDisconnect := Event.ClientDisconnect;
        Client.OnError := Event.ClientError;
        Client.OnRead := Event.ClientRead;
        end;

  Client.Host := '192.168.0.5';
  Client.Port := 6667;

  try
        begin
        Client.active := true;
        writeln('client set active');
        end;
        except writeln('could not set client active');
  end;


  try
        begin
        client.Open;
        writeln('client opened');;
        end;
        except writeln('could not open client');
  end;

sorry, aber das geht auch nich

zumidnest connectet das ding nich wirklich...

Code:
connect() executed!
event created
client created
client set active
connecting...
client opened

text sent
aber das event createn war ja nich wirklich relevant, weil 'connecting' event hat ja vorhin auch schon gefunkt.
nur 'connected' kommt nie
und es localhost, daher muesste es funken. nc -lp 6667 wartet auf incoming connection.
  Mit Zitat antworten Zitat