Link to home
Start Free TrialLog in
Avatar of linuxrox
linuxroxFlag for United States of America

asked on

How do i accept multiple TCP connections using Chilkatsoft's Socket component?

Hello.  I have a lot of components from chilkatsoft and one i'm trying to learn right now is here:
http://www.chilkatsoft.com/refdoc/xChilkatSocketRef.html

i've looked at the examples but what i'm trying to do here is create a small program that listens on a TCP port i choose and just like any type of server app like a web server or ftp server, i want my program to listen for multiple connections etc etc.  what my plan is, is to have my app listen on the port and then have a client running another client app that runs on a schedule i provide and sends a string to the server app on the port i specify.  then the server app, based on what the string is, performs some type of action..like spawning another process etc etc..

is there anyone who has some experience with the chilkatsoft socket component that can provide me with some example code on how to achieve something like this?  i think just the "server" portion is what i would need!

thanks!
Avatar of inthedark
inthedark
Flag of United Kingdom of Great Britain and Northern Ireland image

What language are you using? If you want to us VB6 I have a class which will do exactly what you want. With no hidden code you can see the full picture.

Simply you wait for a new connection; then fire a client who listens to that one connection.

If you want to go that way let me know :~)
Avatar of linuxrox

ASKER

VB6.
that sounds cool.  now is this using chilkat or is this using winsock or something else?
ASKER CERTIFIED SOLUTION
Avatar of inthedark
inthedark
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The example uses Winsock.

I created a simple class that can either be a client or a server.

The server handles incoming clients, once connected they are stacked into a collection of clients.

The client allows you to connect to a server and wait for messages. Incoming messages drive an event where you can decode the message and send a response.
cool!  i'll have a look at this in a while!  thx again!
If you are interested I can post the whole class.
hey that'd be cool as well!!!  
thanks again!! great stuff!! woohoo!
send me a mail to: nick (at) z123 (dot) co (dot) uk

I will reply with a dummy project.