Hello Wesley, TWSocket can connect and listen, but not the same siultanously. Use TWSocketServer for Server and TWSocket for client. Eventually you can derrive your TWSocketclass from TWSocketClient, and use this class for client, and assigne this same class to TWSocketServer. This way you have for all your connections the same component.
If as whell the client as server side sockets has to do more or less the same then you can assign same OnDataAvailable handler to all of them. Use Sender argument to know who it is. --- Rgds, Wilfried http://www.mestdagh.biz Sunday, July 24, 2005, 07:28, Wesley Spadola wrote: > I am creating a program that acts as both a server and a client. It > will connect to other instances of itself running on other computers as > well as listen for other connections. > I was wondering if it is possible to have one TWSocket component, > derived from another TWSocket class but essentially has methods that > will be able to handle clients (eg Listen etc) as well as act as a > client itself (eg Connect etc). > TCustomWSocket looks close, but obviously lacks the OnClientConnect and > Clients[x] etc that would let me code server side routines easily. > I would like to do this to prevent myself from writing two separate > components, but especially having to write two potentially large > OnDataAvailable handlers. > Is such a capability available? What would I have to do? > Cheers, > Wes -- 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