Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Multiple Client to one Server Data sending.

Posted on 2003-02-21
Medium Priority
Last Modified: 2013-11-13
I'm building a client/server software similar setup to a chat program. If there are say, 20 Clients connected to this server all on the same port (say 55), how do I determine which client sent what data and which client to send data back to using winsock. I've been lookign up ConnectionRequest with the requestID and looking up DataArrival and SendData and GetData and I'm having a hard time finding an answer. Maybe I was looking in the wrong spot by not comming here. I like this message board.

Thanks in Advance
Question by:Lloydster

Expert Comment

ID: 8008227
When the Client connects to the server use the ip address to index each message from the client eg: Winsock1.RemoteHostIP


Author Comment

ID: 8008879
I understand what you're saying, and it makes sense, but how do I go about doing that?

Would it be something like this?

Private Sub cmdSend2Server1_Click()
Dim Data2Send

Data2Send = Text1.Text 'Data to send to say, server 1 with IP of

winsock1.RemoteHostIP =  ""
winsock1.SendData Data2Send

End Sub

Accepted Solution

wnaude earned 400 total points
ID: 8014883
have a look at this example by Randy Wable http://www.a1vbcode.com/app.asp?ID=1382
All data is logged with the source IP

This is a chat system developed using winsock control.

Try these projects they should have everything you looking for

Expert Comment

ID: 8901300
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
LVL 49

Expert Comment

ID: 8964090
Moderator, my recommended disposition is:

    Accept wnaude's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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 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…
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.
Suggested Courses

577 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