[twsocket] problem making a custom wrapper/vcl from overbyte server socket.

2010-11-30 Thread simon
?I have a small problem I made a vcl wrapper of the overbyte client socket so 
that I can add my custom data to it with out editing the main overbyte source 
problem I have is when I try to build my app my wrapper can not find the 
client[x].function for my add-ons because right now it says my functions are 
undeclared when there in the public section and work fine if I don't use 
client[x] functions below is a example ...

[code]
  SocketServer.Client[i].Rank;
[/code]

[Pascal Error] mainserverunit.pas(407): E2003 Undeclared identifier: 'Rank'

so my question is how do I have the function so that I can use the client[x] 
feature in my wrapper?

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


Re: [twsocket] problem making a custom wrapper/vcl from overbyte serversocket.

2010-11-30 Thread Arno Garrels
si...@psd-designs.com wrote:
> ?I have a small problem I made a vcl wrapper of the overbyte client
> socket so that I can add my custom data to it with out editing the
> main overbyte source problem I have is when I try to build my app my
> wrapper can not find the client[x].function for my add-ons because
> right now it says my functions are undeclared when there in the
> public section and work fine if I don't use client[x] functions below
> is a example ...  
> 
> [code]
>  SocketServer.Client[i].Rank;
> [/code]
> 
> [Pascal Error] mainserverunit.pas(407): E2003 Undeclared identifier:
> 'Rank' 
> 
> so my question is how do I have the function so that I can use the
> client[x] feature in my wrapper?

What do you call a VCL wrapper? You should derive your own class
from TWSocketClient as shown the (OverbyteIcs)TcpSrv demo.
Don't forget to tell the server the new client class:
WSocketServer1.ClientClass := TMyTcpSrvClient;
After that is done you have to cast the client objects explicitly 
like (SocketServer1.Client[i] as TMyTcpSrvClient).Rank or
TMyTcpSrvClient(SocketServer1.Client[i]).Rank. 

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


Re: [twsocket] problem making a custom wrapper/vcl from overbyte serversocket.

2010-11-30 Thread Francois PIETTE


?I have a small problem I made a vcl wrapper of the overbyte client socket 
so that I can add my custom data to it with out editing the main overbyte 
source problem I have is when I try to build my app my wrapper can not 
find the client[x].function for my add-ons because right now it says my 
functions are undeclared when there in the public section and work fine if 
I don't use client[x] functions below is a example ...


[code]
 SocketServer.Client[i].Rank;
[/code]

[Pascal Error] mainserverunit.pas(407): E2003 Undeclared identifier: 
'Rank'


so my question is how do I have the function so that I can use the 
client[x] feature in my wrapper?


When you use TWSocketServer, there are actually TWO classes involved: 
TWSocketServer and TWSocketClient. The first is the listening socket, the 
second is for handling each connected client.


You said your wrapper was about TWSocketServer but Client[] returns a 
TWSocketClient. You have to make a wrapper for TWSocketClient as well, and 
assign you class to the TWSocketServer.ClientClass. Then at runtime, you can 
cast Client[] to your wrapper and access his properties.


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


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


Re: [twsocket] TWSocketServer: how to make it listening toseveralIP:Port?

2010-11-30 Thread Anton S.
>Probably breaking changes could be iontroduced the day ICS stops supporting 
>non unicode compiler.
>Probably ICS-V8 could be that one, maybe to be released at the same time as 
>Delphi crossplatfom, abandonning support for most of old Delphi version. I'm 
>thinking about letting ICS-V7 live for D7-D2010 and have ICS-V8 for 
>Delphi-XE and the next one.
>Just ideas right now.

Oh, maybe that will be a good occasion for some cleanup and slight code 
redesign. And maybe these changes will include more clear FTPcli error 
reporting (the thing I wrote about several months ago).

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


Re: [twsocket] Using FTPClient in dll

2010-11-30 Thread Busai Péter

Solved.




Hi!

I have to write a dll which downloads some file.
I created a project using example "OverbyteIcsDll2.dpr" as a sample.
There are 2 differences. I must put a form inside the dll, which is just
a user interface to set up and save connection parameters, but this form
is not
created at the time of transfer. So NOFORMS is not defined.
The other difference is that I create a datamodule in the thread, and
ftpcli is created inside that module.
I use async methods.
It is started from a method of datamodule:
   FTPCli.OpenAsync;
   FTPCli.MessageLoop;

The transfer is working fine.
The problem is, when OnSessionClosed is fired, PostMessage sends WM_QUIT
to FTPCli.Handle* but MessageLoop does not exit.

* Also tried FtpCli.ControlSocket.Handle and FtpCli.WndHandler.Handle

What am I missing?
Thank in advance.

Peter


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


Re: [twsocket] TWSocketServer: how to make it listening toseveralIP:Port?

2010-11-30 Thread Francois PIETTE
>Probably breaking changes could be iontroduced the day ICS stops 
>supporting

non unicode compiler.
Probably ICS-V8 could be that one, maybe to be released at the same time 
as
Delphi crossplatfom, abandonning support for most of old Delphi version. 
I'm

thinking about letting ICS-V7 live for D7-D2010 and have ICS-V8 for
Delphi-XE and the next one.
Just ideas right now.


Oh, maybe that will be a good occasion for some cleanup and slight code 
redesign.


Sure ! And also to benefit from new construct in the language such as 
generics and others.


And maybe these changes will include more clear FTPcli error reporting 
(the thing I wrote about several months ago).


Maybe.

Designing V8 will be a long process. Every option is still open. My dream is 
to have a single source code for Windows, MAC and Linux. This probably means 
ICS-V8 will looks more like ICS-for-Kylix than current ICS version. This is 
because MAC OSX and Linux do not work with messages as Windows do.


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

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


Re: [twsocket] TWSocketServer: howtomakeitlisteningtoseveralIP:Port?

2010-11-30 Thread Arno Garrels
Arno Garrels wrote:

> Back to the keyboard then. I think a found a way everybody can live
> with. Will commit this new attempt to the IPv6 branch when I think
> it's alpha-ready. Then we are able to continue the discussion based
> on an existing implementation.

Done, IPv6 branch updated (new multi-listen feature in TWSocketServer and 
descendants).

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


Re: [twsocket] TWSocketServer: how to make it listeningtoseveralIP:Port?

2010-11-30 Thread Arno Garrels
Francois PIETTE wrote:
>>> Probably breaking changes could be iontroduced the day ICS stops
>>> supporting
>>> non unicode compiler.
>>> Probably ICS-V8 could be that one, maybe to be released at the same
>>> time as
>>> Delphi crossplatfom, abandonning support for most of old Delphi
>>> version. I'm
>>> thinking about letting ICS-V7 live for D7-D2010 and have ICS-V8 for
>>> Delphi-XE and the next one.
>>> Just ideas right now.
> 
>> Oh, maybe that will be a good occasion for some cleanup and slight
>> code redesign.
> 
> Sure ! And also to benefit from new construct in the language such as
> generics and others.
> 
>> And maybe these changes will include more clear FTPcli error
>> reporting (the thing I wrote about several months ago).
> 
> Maybe.
> 
> Designing V8 will be a long process. Every option is still open. My
> dream is to have a single source code for Windows, MAC and Linux.
> This probably means ICS-V8 will looks more like ICS-for-Kylix than
> current ICS version. This is because MAC OSX and Linux do not work
> with messages as Windows do. 

IMO emulating windows messages on the MAC and Linux is just a 
workaround, if not a TRUE hack ;)

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


Re: [twsocket] Using FTPClient in dll

2010-11-30 Thread Arno Garrels
Busai Péter wrote:
> Solved.

That's great, please describe briefly the cause of the problem
and how it was solved, readers of this list might benefit from
your findings and save some time.

-- 
Arno Garrels


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


Re: [twsocket] Using FTPClient in dll

2010-11-30 Thread Busai Péter



Solved.

That's great, please describe briefly the cause of the problem
and how it was solved, readers of this list might benefit from
your findings and save some time.



Well, I do not clearly understand the internals, but defining NOFORMS in 
project option

and  using
while not FTPCli.Terminated do
  FTPCli.ProcessMessages;

instead of

  FTPCli.MessageLoop

and quitting with FTPCli.PostQuitMessage did work.

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


Re: [twsocket] problem making a custom wrapper/vcl from overbyteserversocket.

2010-11-30 Thread simon

?here my code so fare

http://projects.psd-designs.com/servercode.txt

so you can see what am trying to do basically all I want is a custom vcl 
based on the serversocket so that am able to add my own options with out 
effecting overbyte source.


-Original Message- 
From: Arno Garrels

Sent: Tuesday, November 30, 2010 1:59 PM
To: ICS support mailing
Subject: Re: [twsocket] problem making a custom wrapper/vcl from 
overbyteserversocket.


si...@psd-designs.com wrote:

?I have a small problem I made a vcl wrapper of the overbyte client
socket so that I can add my custom data to it with out editing the
main overbyte source problem I have is when I try to build my app my
wrapper can not find the client[x].function for my add-ons because
right now it says my functions are undeclared when there in the
public section and work fine if I don't use client[x] functions below
is a example ...

[code]
 SocketServer.Client[i].Rank;
[/code]

[Pascal Error] mainserverunit.pas(407): E2003 Undeclared identifier:
'Rank'

so my question is how do I have the function so that I can use the
client[x] feature in my wrapper?


What do you call a VCL wrapper? You should derive your own class
from TWSocketClient as shown the (OverbyteIcs)TcpSrv demo.
Don't forget to tell the server the new client class:
WSocketServer1.ClientClass := TMyTcpSrvClient;
After that is done you have to cast the client objects explicitly
like (SocketServer1.Client[i] as TMyTcpSrvClient).Rank or
TMyTcpSrvClient(SocketServer1.Client[i]).Rank.

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


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


Re: [twsocket] Using FTPClient in dll

2010-11-30 Thread Arno Garrels
Busai Péter wrote:
>>> Solved.
>> That's great, please describe briefly the cause of the problem
>> and how it was solved, readers of this list might benefit from
>> your findings and save some time.
>> 
> 
> Well, I do not clearly understand the internals, but defining NOFORMS
> in project option
> and  using
> while not FTPCli.Terminated do
>   FTPCli.ProcessMessages;
> 
> instead of
> 
>   FTPCli.MessageLoop
> 
> and quitting with FTPCli.PostQuitMessage did work.

You must be using some current ICS version. That's positive 
feedback! PostQuitMessage was introduced recently to ease quit
of the message loop.

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


Re: [twsocket] Using FTPClient in dll

2010-11-30 Thread Busai Péter



2010.11.30. 20:41 keltezéssel, Arno Garrels írta:



Well, I do not clearly understand the internals, but defining NOFORMS
in project option
and  using
 while not FTPCli.Terminated do
   FTPCli.ProcessMessages;

instead of

   FTPCli.MessageLoop

and quitting with FTPCli.PostQuitMessage did work.

You must be using some current ICS version. That's positive
feedback! PostQuitMessage was introduced recently to ease quit
of the message loop.


My first thing was to update from svn ;)
However I think the above design not very nice, since CPU is on 100% 
while transfer is taking place.


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


Re: [twsocket] Using FTPClient in dll

2010-11-30 Thread Arno Garrels
Busai Péter wrote:
> 2010.11.30. 20:41 keltezéssel, Arno Garrels írta:
>> 
>>> Well, I do not clearly understand the internals, but defining
>>> NOFORMS in project option
>>> and  using
>>>  while not FTPCli.Terminated do
>>>FTPCli.ProcessMessages;
>>> 
>>> instead of
>>> 
>>>FTPCli.MessageLoop
>>> 
>>> and quitting with FTPCli.PostQuitMessage did work.
>> You must be using some current ICS version. That's positive
>> feedback! PostQuitMessage was introduced recently to ease quit
>> of the message loop.
> 
> My first thing was to update from svn ;)
> However I think the above design not very nice, since CPU is on 100%
> while transfer is taking place.

That's true, you should not call ProcessMessages in a loop like
above. NOFORMS and MessageLoop should work. Otherwise show us some
more of your code.
  
-- 
Arno Garrels
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] problem making a custom wrapper/vcl fromoverbyteserversocket.

2010-11-30 Thread Arno Garrels
si...@fantaziachat.com wrote:
> ?here my code so fare
> 
> http://projects.psd-designs.com/servercode.txt
> 
> so you can see what am trying to do basically all I want is a custom
> vcl based on the serversocket so that am able to add my own options
> with out effecting overbyte source.

I see, so it's a component derived directly from TWSocketServer.
There's also the option to encapsulate an instance of TWSocketServer
in an outer (wrapper) component and to expose only those methods and
properties actually needed. 

{code}
type
TMyWrapper = class(TIcsWndControl)
private
  FSocketServer: TWSocketServer;
public
  constructor Create(AOwner: TComponent); override;
  procedure Listen;
end; 

implementation

constructor TMyWrapper.Create(AOwner: TComponent);
begin
  inherited;
  FSocketServer := TWSocketServer.Create(Self);
end;

procedure TMyWrapper.Listen;
begin
  FSocketServer.Listen;
end; 
{code}

The THttpServer and TFtpServer are designed like that which
makes much sense with TWSocketServer since it exposes tons
of unused methods, properties and events of its ancestor
class TWSocket. 

-- 
Arno Garrels

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