Re: VB.NET Socket - Multiple clients to server
From: William Stacey [MVP] (staceywREMOVE_at_mvps.org)
Date: 08/18/04
- Next message: Jon Skeet [C# MVP]: "Re: VB.NET Socket - Multiple clients to server"
- Previous message: Rubbrecht Philippe: "Determine connection state to enable offline capabilities"
- In reply to: User: "Re: VB.NET Socket - Multiple clients to server"
- Next in thread: User: "Re: VB.NET Socket - Multiple clients to server"
- Reply: User: "Re: VB.NET Socket - Multiple clients to server"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Aug 2004 10:50:43 -0400
A socket is unique with 4 pieces of info:
1) server ip
2) server port
3) client ip
4) client port
So you have many sockets all connecting to same server ip and port as long
as client ip/port is different, which they will be. If the same client trys
to connect with same local port twice, it will fail locally trying to grab a
local socket that is using same ip and port (IIRC).
-- William Stacey, MVP "User" <guest@guest.com> wrote in message news:OPJUc.25312$X12.22077@edtnps84... > I thought that a port number was unique to one socket? Is that right? > > In my implementation, I use the port number as an identifier for the > client connection. If I use one socket, is there a unique identifier > for any accepted connection? > > Thank you! > > > > Jon Skeet [C# MVP] wrote: > > > User <guest@guest.com> wrote: > > > >>I tried to find the information over the internet but didn't find any > >>answers. > >> > >>I'm looking for a server side code example of winsock accepting many > >>clients. I know that in VB.NET it is not implemented like in VB6. What > >>I've done is one client per socket. Meaning that each client used a > >>different port on the server, but I find it annoying. > >> > >>I would like to have all clients to connect to the server using one port. > > > > > > Just because they're using different sockets doesn't mean that clients > > have to connect to different ports. Just use TcpListener and call keep > > AcceptTcpClient or AcceptSocket and everything will be fine. > > >
- Next message: Jon Skeet [C# MVP]: "Re: VB.NET Socket - Multiple clients to server"
- Previous message: Rubbrecht Philippe: "Determine connection state to enable offline capabilities"
- In reply to: User: "Re: VB.NET Socket - Multiple clients to server"
- Next in thread: User: "Re: VB.NET Socket - Multiple clients to server"
- Reply: User: "Re: VB.NET Socket - Multiple clients to server"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|