linuxrox
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!
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!
ASKER
VB6.
ASKER
that sounds cool. now is this using chilkat or is this using winsock or something else?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
ASKER
cool! i'll have a look at this in a while! thx again!
If you are interested I can post the whole class.
ASKER
hey that'd be cool as well!!!
ASKER
thanks again!! great stuff!! woohoo!
send me a mail to: nick (at) z123 (dot) co (dot) uk
I will reply with a dummy project.
I will reply with a dummy project.
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 :~)