VB - Winsock - connect again with remote computer.

Posted on 2003-03-19
Medium Priority
Last Modified: 2013-11-13
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.
Question by:tittlejoseph
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8174485

Can you post some sample code ...


Expert Comment

ID: 8176919
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.

Author Comment

ID: 8180517

i'll check the code and will let you know if it works fine.
LVL 27

Expert Comment

ID: 8185916
Try to change from TCP to UDP.
I had similar problems to you, and that solved it


Accepted Solution

MILU earned 300 total points
ID: 8189151
Hello ,
    Download the code from www.geocities.com/milu_7001
This will solve all your problems.


Please see the question


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question