Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help with Winsock Control

Posted on 2002-07-15
7
Medium Priority
?
207 Views
Last Modified: 2013-11-13
Hello Experts:

What I actually need is some help with Winsock connection management.  I am working on an application that has some functionality similiar to ICQ or AIM.

I have a client application and server application and can successfully connect multiple clients to the application, but the problem i am having is managing who is connected to each instance of the Winsock control.

Does anyone have any suggestions on how to manage this, so when user A on Winsock(1) wants to send a message to user C on Winsock(3), this can be accomplished successfully.
0
Comment
Question by:escheider
  • 4
  • 3
7 Comments
 
LVL 2

Expert Comment

by:yongyih
ID: 7154570
How about create a two dimension array.
nick name and which winsock
user A , 1
user B , 2
user C , 3

when user send message, winsock will send "*user C*" in front of message.  e.g.  "*user C*Hi, how are you?"
then you will have a function to retrieve the 'user C' from message.

after that, use it to check the nick name in array and send to correct person.
0
 
LVL 4

Author Comment

by:escheider
ID: 7154577
I was thinking along those lines but won't that be tremendous overhead if say 100 people connect to the server?  

Also, what if user B drops out --  that would require some complex array management.
0
 
LVL 4

Author Comment

by:escheider
ID: 7154588
I think it would be slick to have it store the connection that the users are connected to, then that could be passed as a parameter..so

User(1)=UserA
User(2)=UserB

and the array element would indicate which Sock(x) that user is connected to...but seems like complex array management.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 2

Accepted Solution

by:
yongyih earned 200 total points
ID: 7154633
If don't want to use array, how about using Microsoft Access to store those information?  A table with at least two fields.  one for nick name, another one for which winsock.(another field for status if you want ^_^)


when a connection fail/close, just delete that record for that instance of winsock.

when look for an user name/nick name, just search a record in table..

0
 
LVL 4

Author Comment

by:escheider
ID: 7154835
interesting thought.  Im actually using an Access database already to keep track of member names, so I'll give this a try.
0
 
LVL 2

Expert Comment

by:yongyih
ID: 7157311
have you solve your problem?? ^_^
0
 
LVL 4

Author Comment

by:escheider
ID: 7157328
yes it did...thanks for the quick and easy suggestion.  it works like a champ.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to implement Singleton Design Pattern in Java.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
Suggested Courses

886 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