|
-
Aug 12th, 2009, 03:12 PM
#1
Thread Starter
Member
Managing Multiple Socket Connections Over WAN
Alright so I have computer A,B,C
Computer a resides on its own network. Computer B,C are on their own network together.
So computer A is a server that recv's multiple socket connections at the same time from clients B,C over the internet. The issue for me is when they connect via TCP to the server each one socket the server handles each connection perfectly fine but when they both add a socket connection making 4 connections how can I make the server tell which sockets belong together in a group by Computer B, And Computer C, so I do not get them mixed up?! I do not want to send information to computer C that needs to go to B when feeding streaming information. Should I on connect send them a Large random number that they send through with every socket connection so I know that the new connection is coming from a existing computer that already connected? Ideally I would look for the IP being different but both of them coming from the same WAN address will not help in this case =(
-
Aug 12th, 2009, 03:23 PM
#2
Re: Managing Multiple Socket Connections Over WAN
If B and C both connects to A, how does that create 4 connections?
So your problem is basically, if they both are connected at the same time, you need to be able to identify them? What language are you using?
-
Aug 12th, 2009, 03:31 PM
#3
Thread Starter
Member
Re: Managing Multiple Socket Connections Over WAN
Like for instance Lets say I got media I wanted to stream.
like for instance two songs, JUST FOR EXAMPLE
every time a socket connects it will download a different song.
So if both computers B, C connect with two sockets each making four, How can A(The Server) detect a 2nd socket connection from each and stream the next media to that computer. make sense? Like if one was a video feed and other was a Sound feed?
Language... Doesn't matter I can do it in anything from ASM to VC++ to vb.net, its not the language that seems to be the issue for me at hand its the protocol and identify that socket belongs what what other sockets to stream the media to the right place. But an Example if that's what you mean in any language will work =D.
Is making a custom protocol what I need?
Last edited by AgentSmithers; Aug 12th, 2009 at 03:44 PM.
-
Aug 12th, 2009, 03:48 PM
#4
Re: Managing Multiple Socket Connections Over WAN
Aha, so computer B and C both create 2 connections each to the server. And you want to know what pair of connections on the server side belongs to the same computer?
If I got it right, then there are multiple ways you could identify them I suppose.
The computers could send something just after they've created the 2 connections that identifies the computer, such as the MAC address. However unique identifiers can be troublesome.
Another solution is this:
Imagine Computer A having a bunch of connections to it, and it does not know what pair of connections to group together. It could then take one connection randomly, lets say its one of Computer Bs connections, and send a number to it.
Computer B would receive this number and respond by sending it back on the other connection. When Computer A receives this number on one of its many unidentified connections, it'll know that the two connections are connected to the same host and can group them together.
Just an idea that came to me just now.
-
Aug 26th, 2009, 06:53 AM
#5
Member
Re: Managing Multiple Socket Connections Over WAN
Lets see if I got this right...
So everytime a computer connects for data they could use there harddrive serial number as a semi unique ID. That way you would have not only the IP address but the HD serial number so you "could" two computer apart even if there are connected behind the same router.
Example 1 - Same router
Computer B ip 123.45.67.89 HD 1234567890
Computer C ip 123.45.67.89 HD 0987654321
Example 2 - Different locations
Computer B ip 123.45.67.89 HD 1234567890
Computer C ip 98.76.54.32 HD 0987654321
-
Aug 26th, 2009, 08:54 AM
#6
Re: Managing Multiple Socket Connections Over WAN
The MAC address would be a better unique ID than the HD serial number as MAC addresses have to be universally unique
-
Aug 26th, 2009, 09:22 AM
#7
Re: Managing Multiple Socket Connections Over WAN
 Originally Posted by chris128
The MAC address would be a better unique ID than the HD serial number as MAC addresses have to be universally unique
I agree that using the MAC address as an identifier would be a better choice, however not even that is guaranteed to be unique as MAC addresses can be spoofed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|