Hello,

On Thu, Nov 25, 2010 at 5:04 PM, Arno Garrels <arno.garr...@gmx.de> wrote:

> Fastream Technologies wrote:
> > Ok, managed the SVN. Now what should I do for an IPv4 ICS
> > client/server to upgrade to IPv6? I saw almost no documentation in
> > the source. Can applications support both protocols with no
> > modification or must one make a separate listening/target IP per v4
> > and v6?
>
> I added some experimental multi-listen stuff.
> See OverbyteIcsTcpSrv1IPv6 demo, especially TTcpSrvForm.WMAppStartup
> and TTcpSrvForm.WSocketServer1BeforeClientCreate.
>
> It works fine, however its design is not the best so will most
> likely change. For instance, a listening socket cannot be closed
> separately without closing all other listening sockets as well,
> or if one socket fails to listen in new method TcpMultiListen
> the already listening sockets are closed (and an exception
> is raised).
>
> --
> 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
>

As you said the below function and the design that is forcing it is not
good. Perhaps we should have Addrv6 property which will be null if Addr (v4)
is filled and vice versa.

procedure TTcpSrvForm.WSocketServer1BeforeClientCreate(Sender: TObject;
  AListenSocketInfo: TListenSocketInfo; var AClientClass:
TWSocketClientClass);
begin
    { Use this event to get info about the listening socket accepted }
    { a connection. Optionally change the client class that will be  }
    { created.                                                       }
    if AListenSocketInfo <> nil then begin
       { When listening with method TcpMultiListen AListenSocketInfo }
       { is assigned.                                                }
       Display('BeforeClientCreate: Listening socket ' +
               AListenSocketInfo.FAddrStr + '/' +
               IntToStr(AListenSocketInfo.FPortNum));
    end
    else begin
        { If method Listen was called AListenSocketInfo is unassigned }
        Display('BeforeClientCreate: Listening socket ' +
               TWSocketServer(Sender).Addr + '/' +
               IntToStr(TWSocketServer(Sender).PortNum));
    end;
end;

SZ
--
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

Reply via email to