Click here to Skip to main content
15,887,436 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a local network with over than 150 users.
I want to write a program to recognize my users login and logout in VB.net 2008.
For this purpose I want to write an TCP or UDP windows sub or function and put it in my application load to recognize client login and know how log in and when my user logout normally or specially abnormally (when my application suddenly closed), i can to recognize which client disconnected.
Please guide me and put a sample client and server listener application if is possible.
Thanks
Posted
Updated 10-Dec-10 5:28am
v2
Comments
fjdiewornncalwe 10-Dec-10 12:37pm    
I'm sure you would like for us to provide you with the code, but it doesn't work that way. What have you tried and what are specific issues you have encountered? Without that you're not likely to get all that much help in here.
Dave Kreskowiak 10-Dec-10 13:36pm    
You think you're going to do this in one sub or function? Why don't you add logging code to various parts of your communication system so you can see when people login, logout, or when data is transfered?
ghafarzadeh 11-Dec-10 0:42am    
Thanks for your comments,
I think I couldn't express my purpose.
I wrote a TCP-listener for my server part that wait for connections and it can detect the clients that connect to the server, but I couldn't recognize which client now connected(I can send a socket massage and send username or IP address).
And I wrote a TCP-Client for my client part and it can make socket connection to my server listener.
Now I have this questions:
1- How I could recognize client ID that connected to my server listener?
2- How I could detect which of my clients disconnect now(disconnect normally or abnormally)
3- Should I take opened my client socket during that use my application to detect disconnect.

1 solution

Thanks for your comments,
I think I couldn't express my purpose.
I wrote a TCP-listener for my server part that wait for connections and it can detect the clients that connect to the server, but I couldn't recognize which client now connected(I can send a socket massage and send username or IP address).
And I wrote a TCP-Client for my client part and it can make socket connection to my server listener.
Now I have this questions:
1- How I could recognize client ID that connected to my server listener?
2- How I could detect which of my clients disconnect now(disconnect normally or abnormally)
3- Should I take opened my client socket during that use my application to detect disconnect.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900