Link to home
Start Free TrialLog in
Avatar of tittlejoseph
tittlejosephFlag for India

asked on

VB - Winsock - connect again with remote computer.

I'm successfully connected with a remote computer through winsock in VB 6.0.  I can do anything with that system. But if i close my application and next time i try to connect it doesnt get connects, it may be happen since one connection is already open. I think it should access server_connectionrequest method of remote computer everytime it asks for a new connection. But control doesnt even get into this method.

This is something like a server is always running on remote computer, but i can close my client app whenever i wish, and can then connect with remote whenever i want. I dont want to be connected with remote all the time and i dont want my client application to be remain open.
e.g. run a key log on remote and then exit. in evening get connect again and get detail of key log.
Avatar of Alon Hirsch
Alon Hirsch
Flag of Australia image

Hi,

Can you post some sample code ...

Alon
Avatar of vpalmu
vpalmu

Do you call the "Close" method of your winsock component
on Form_Unload procedure ?

On my program I close the socket port with following code:

    1: Winsock_client.Close
    2: Winsock_client.RemotePort = 0

After closing my app I can run it again and a new connetion is always estabilished.
Avatar of tittlejoseph

ASKER

vpalmu,

i'll check the code and will let you know if it works fine.
Try to change from TCP to UDP.
I had similar problems to you, and that solved it

Dabas
ASKER CERTIFIED SOLUTION
Avatar of MILU
MILU

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