Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Imperceptus on May 13, 2005, 10:20 AM

Title: To use more then 1 socket?
Post by: Imperceptus on May 13, 2005, 10:20 AM
I am making a game client for Ragnarok Online.  The Server is actually made up of 3 Programs each running on a different Port.  I am Currently Using 3 different sockets to handle the 3 different servers, but Im pretty sure that It could be done with 1 socket. What would you do?
Title: Re: To use more then 1 socket?
Post by: R.a.B.B.i.T on May 13, 2005, 12:01 PM
I would use an array of sockets.
Title: Re: To use more then 1 socket?
Post by: Imperceptus on May 13, 2005, 12:20 PM
I thought of that solution myself as well, A good Idea, but I hate passing around the stupid index of the socket.
Title: Re: To use more then 1 socket?
Post by: Yegg on May 13, 2005, 02:09 PM
I agree with rabbit, arrays are the best way to go when you want to work with multiple sockets (or other classes) and have easy access to them.
Title: Re: To use more then 1 socket?
Post by: Warrior on May 13, 2005, 03:07 PM
afaik just create a new instance of the object by refrencing it
Title: Re: To use more then 1 socket?
Post by: UserLoser. on May 13, 2005, 07:54 PM
If it uses UDP you could possibly use one socket
Title: Re: To use more then 1 socket?
Post by: R.a.B.B.i.T on May 13, 2005, 08:02 PM
That's true, but from the way he described it it sounded like TCP, so that's what I went with.
Title: Re: To use more then 1 socket?
Post by: Imperceptus on May 14, 2005, 09:59 PM
Heres how things work

I connect to server 1, talk to it a bit, get a message that i then use to connect to server 2, talk with server 2 then get a message that i use to connect with server 3 from which I sustain my connection with., I dont need to be connected to all the servers at the same time at all. 

Title: Re: To use more then 1 socket?
Post by: LivedKrad on May 15, 2005, 01:56 AM
Looks to me like you only need to maintain one connection at any given time.
Title: Re: To use more then 1 socket?
Post by: R.a.B.B.i.T on May 15, 2005, 10:31 AM
In which case you could simply use 1 socket and not have to deal with multiple controls or the passing of an index variable.