Re: [twsocket] FTP Client - Size() Function

2005-07-31 Thread Frank Wunderlich
Angus Robertson - Magenta Systems Ltd schrieb:
 The only bullet proof way is use CWD and DIR to get a directory 
 listing, and parse it (many different formats) to get the file size.  
 These commands are supported by all FTP servers. 

is there any parsing routine available which works for windows and 
unix-servers?

Greets Frank
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Servertimeout ... i don't get it working

2005-07-07 Thread Frank Wunderlich

Arno Garrels schrieb:


Frank Wunderlich wrote:
 


Arno Garrels schrieb:

   


Frank Wunderlich wrote:


 


Hallo Arno,

am Freitag, 1. Juli 2005, 18:52:25 hast du geschrieben:



   


Arno Garrels wrote:


 


Hello Frank,

I've just tweaked the orginal Tcpsrv demo a bit. Dropped a timer on it
and let it send something in intervals, then I pluged off the patch
cable and here is the log:

There is now 1 clients connected.
Received from 192.168.178.200: 'who'
Client disconnecting: 192.168.178.200   Duration: 00:01:08Error: 10053
There is now 0 clients connected.

It is exactly working as we told you.

Arno Garrels


   


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


 


where did you generate that log (the line with errorcode). is this the
onclientdisconnect?


   


Yes, take a look at Tcpsrv demo, I only added  + 'Error: ' +
IntToStr(Error) 




 


how do you send (the same way i do?)?


   


Yes, iterating thru the list of clients sending a string.

Arno Garrels



 


it does really not work for...here the changes in the tcpsvr-demo:

procedure TTcpSrvForm.Timer1Timer(Sender: TObject);
var i:integer;
begin
 for i:=0 to WSocketServer1.ClientCount-1 do
 begin
   WSocketServer1.Client[i].SendStr('Blah'+#13#10);
 end;
end;

procedure TTcpSrvForm.WSocketServer1ClientDisconnect(
   Sender : TObject;
   Client : TWSocketClient;
   Error  : Word);
begin
   with Client as TTcpSrvClient do begin
   Display('Client disconnecting: ' + PeerAddr + '   ' +
   'Duration: ' + FormatDateTime('hh:nn:ss',
   Now - ConnectTime)+' Error: '+IntToStr(Error));
   Display('There is now ' +
   IntToStr(TWSocketServer(Sender).ClientCount - 1) +
   ' clients connected.');
   end;
end;

the server does not fire the onclientdisconnect in my application...i
don't know why...
what have you done in another way?
   



No difference - very strange, my conf. was W2k-SP4, ethernet 100Mbit.

Arno Garrels
 
 

i have win xp (SP2) on client and server, ethernet 100MBit/s, ICS 
TWSocket 4.45 TWSocketServer 1.07, TCPSvr-Demo 1.04.


i can send you the full source-code if you have another demo-version.

Greets frank

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re[2]: [twsocket] Servertimeout ... i don't get it working

2005-07-02 Thread Frank Wunderlich
Hallo Arno,

am Freitag, 1. Juli 2005, 18:52:25 hast du geschrieben:

 Arno Garrels wrote:
 Hello Frank,
 
 I've just tweaked the orginal Tcpsrv demo a bit. Dropped a timer on it
 and let it send something in intervals, then I pluged off the patch
 cable and here is the log:
 
 There is now 1 clients connected.
 Received from 192.168.178.200: 'who'
 Client disconnecting: 192.168.178.200   Duration: 00:01:08Error: 10053
 There is now 0 clients connected.
 
 It is exactly working as we told you.
 
 Arno Garrels

 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

where did you generate that log (the line with errorcode). is this the
onclientdisconnect?
how do you send (the same way i do?)?

-- 
Greets Frank
mailto:[EMAIL PROTECTED]


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Servertimeout ... i don't get it working

2005-07-01 Thread Frank Wunderlich

Fredrik Larsson schrieb:


The TWSocketClientClass is same as TWSocket. I am quite sure that you can
add the onchangestate event just by typecasting to TWSocket.
The following compiles ok... 


procedure TForm1.WSocket1ChangeState(Sender: TObject; OldState,
 NewState: TSocketState);
begin
//do something
end;

procedure TForm1.WSocketServer1ClientConnect(Sender: TObject;
 Client: TWSocketClient; Error: Word);
begin
 twsocket(client).OnChangeState := WSocket1ChangeState;
end;

Regards, Fredrik.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Frank Wunderlich
Sent: Thursday, June 30, 2005 11:04 PM
To: twsocket@elists.org
Subject: [twsocket] Servertimeout ... i don't get it working

Hi,
i've asked you a few days before because i want to make my server watch for
loosing connections.
the client has the event OnChangeState but the server have nothing like this
for the client-connection-lost (not disconnect).
i tried to set events for new created clients, ive tried to send data to the
client and waiting for an error, but noting happens ; can anybody give me a
delphi-example to show how to doing this?

hope you can help

Greets Frank

--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be



 

its right, that have i trying, too. but this recognizes only normal 
disconnect and fires an AccessViolation. ;


Greets Frank

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] problems with OnDataAvailable

2005-06-27 Thread Frank Wunderlich
Hi, 
i trying to send a record with TWSocket in delphi (code below).
send/receive works well, but when i close the connection to the server.
OnDataAvailable is fired and i get a message (from my showmessage) with
strange signs. That means i cast the incoming data to my record an get
something useless stuff ;. How can i prevent this?


//*** the client 
//connecting to server
procedure TForm1.Btn_ConnectClick(Sender: TObject);
begin
  WSocket1.Proto:='tcp';
  WSocket1.Addr:=Edit_Addr.Text;
  WSocket1.Port:=Edit_Port.Text;
  Wsocket1.Connect;
end;

//sending
var msgrec:Tmsgrec; //msgrec is a simple record-struct with 1 string[255]

  if wsocket1.State=wsConnected then
  begin
msgrec.MsgText:='my text';
Wsocket1.Send(@msgrec,sizeof(msgrec));
  end else showmessage('not connected');

//* the server ***
// starting the server
procedure TForm1.Btn_ListenClick(Sender: TObject);
begin
  WSocket1.proto:='tcp';
  WSocket1.Addr:='0.0.0.0';
  WSocket1.Port:='5';
  wsocket1.Listen;
end;

//accepting all incomming connections
procedure TForm1.WSocket1SessionAvailable(Sender: TObject; Error: Word);
begin
 wsocket1.HSocket:=Wsocket1.Accept;
end;

//receiving data
procedure TForm1.WSocket1DataAvailable(Sender: TObject; Error: Word);
var msgrec: Tmsgrec;
Src   : TSockAddrIn;
SrcLen: Integer;
RemoteAddr: string[15];
begin
  if error=0 then
  begin
SrcLen := SizeOf(Src);
wsocket1.ReceiveFrom(@MsgRec,SizeOf(MsgRec),Src,SrcLen); 
if SrcLen0 then
begin
RemoteAddr:=inet_ntoa(src.sin_addr); //IP ermitteln
if msgrec.msgtext'' then showmessage(msgrec.msgtext);
end;
  end;
end;

i found nothing usefult in google, hope you can help...

greets frank

-- 
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] detecting disconnect from twsocketserver

2005-06-27 Thread Frank Wunderlich
Hi,
i've trying to detect when a client is abnormal disconnected from the server
(calling not the close-procedure). e.g. when the lan-cable is taken out.
the client detects the disconnect,but the server don't call the
OnClientDisconnect.

How can i realize that?

Greets frank

-- 
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden  testen ++ http://www.gmx.net/de/go/promail ++

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] detecting disconnect from twsocketserver

2005-06-27 Thread Frank Wunderlich
 You could check a 'last alive' time stamp stored in your client class.
 Cleanup the client after a timeout has elapsed. Use a single Timer to
 check all clients actually in the list in intervals.
 
 Arno Garrels

sure but how can i check the clients are reachable?

frank

-- 
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] detecting disconnect from twsocketserver

2005-06-27 Thread Frank Wunderlich
  You could check a 'last alive' time stamp stored in your client class.
  Cleanup the client after a timeout has elapsed. Use a single Timer to
  check all clients actually in the list in intervals.
  
  Arno Garrels
is there a procedure to send something direct to the clients or do i need a
2nd TWsocket, getting the client adress and send to that?

frank

-- 
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden  testen ++ http://www.gmx.net/de/go/promail ++

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be