468,719 Members | 1,698 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,719 developers. It's quick & easy.

Winsock

Hello all

i need a solution to the following problem

I have an application which listens to a port for incoming connections from
a client via a Winsock. let's call this Winsock1

Upon a connection of a client i would like the application to call an
ActiveX.exe which also has a Winsock Control (Winsock2), and i would like to
transfer the Winsock1 information to Winsock2, hence allowing the client
now to talk
directly to the Winsock2 on the ActiveX control,
and hence freeing up the Winsock1 to start listening again.
And if another client connects then i would like the same to happen again.
So basically i would find a number of the activex.exe being called.
This would have to be Asynchronus i.e. both clients being processed
simultaneuously

TIA

Jul 17 '05 #1
1 3253

"N.Naeem" <nn****@REMTHISportech.co.uk> wrote in message
news:3f***********************@auth.uk.news.easyne t.net...
Hello all

i need a solution to the following problem

I have an application which listens to a port for incoming connections from a client via a Winsock. let's call this Winsock1

Upon a connection of a client i would like the application to call an
ActiveX.exe which also has a Winsock Control (Winsock2), and i would like to transfer the Winsock1 information to Winsock2, hence allowing the client
now to talk
directly to the Winsock2 on the ActiveX control,
and hence freeing up the Winsock1 to start listening again.
And if another client connects then i would like the same to happen again.
So basically i would find a number of the activex.exe being called.
This would have to be Asynchronus i.e. both clients being processed
simultaneuously

TIA

This is how I would attempt it

Create a ClientConnectionManager
Set up a Socket Array
Listen on Socket 0 for a connection at all times
When a request is received create (load) next free socket

Accept the client request to the newly created socket,
Winsock1(TheNextIndex).Accept ID
then immediately (in the same event)

Create a New AX instance & Call a method that creates a socket &
returns its random Listening port number example.Sub called
CreateSocketConn.

Example call
Winsock1(TheNextIndex).SendData "Use" & AXinstance.CreateSocketConn()

So first time the client successfully connects it will receive a random port
number where it can close the first connection & reconnect to the port the
AX will be listening on.
Other details would need to be incorporated no doubt
e.g. The AX shuts down after a certain time if the connection is not
successful.
and some event error handling bla....bla.......
HTH
Geoff
--



Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Niels Borg | last post: by
1 post views Thread by Chris Thompson | last post: by
1 post views Thread by Yu Chai | last post: by
5 posts views Thread by kc | last post: by
1 post views Thread by Nicolas Ghesquiere | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.