Author |
Message |
Decadence666
![](http://i14.tinypic.com/48w0soi.gif)
|
Posted: Tue Jun 26, 2007 3:32 pm Post subject: Connect to more than two people? |
|
|
I've gotten my chat program to work alright, but its currently just P2P. I'm wondering how to connect to more than 1 other client...
I imagine you need a server program running, clients send a message to the server then the server spits them all back out to the clients..
The problem is I just don't know how to do this in turing...
Does anybody have some example programs they could share with me?
Thanks. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
allrace1337
|
Posted: Mon Sep 24, 2007 4:42 pm Post subject: Re: Connect to more than two people? |
|
|
I wouldn't use Turing... it can't really do that much. |
|
|
|
|
![](images/spacer.gif) |
mitchenerjosh
![](http://compsci.ca/v3/uploads/user_avatars/193320990346f1bc2af3610.jpg)
|
Posted: Mon Sep 24, 2007 4:49 pm Post subject: RE:Connect to more than two people? |
|
|
WHAT ARE YOU TALKING ABOUT!!! If you can acheave big things in turing then your a program master for lazzy languages like Visual Basic |
|
|
|
|
![](images/spacer.gif) |
Wolf_Destiny
![](http://compsci.ca/v3/uploads/user_avatars/152219065473127fae8c5e.jpg)
|
Posted: Mon Sep 24, 2007 5:35 pm Post subject: Re: Connect to more than two people? |
|
|
Unless of course you get stuck in Turing's easy syntax, and can't bring yourself to adapt to new, dumber syntax.
But then again I agree with you, solving a complicated problem with a really simple language like Turing would improve your problem solving abilities, instead of just using one command in another language to do the same thing.
~S.Lyon
P.S. I'm actually going to answer the first post too!
In order to connect to two (or more) clients the server would just have to wait for them to connect one at a time.
Wait for Client1 on Port 1
Connected to Client1
Wait for Client2 on Port 2
Connected to Client2
You just need two separate stream variables, netaddress variables, and two different ports. |
|
|
|
|
![](images/spacer.gif) |
Saad
![](http://compsci.ca/v3/uploads/user_avatars/182387547249e7ebb91fb8a.png)
|
Posted: Mon Sep 24, 2007 6:06 pm Post subject: RE:Connect to more than two people? |
|
|
Or just use an array to store each client and have a listener port. If the listener port is called on then it provides the caller with the correct port to connect to.
Ps. You may want to keep pinging the client to check if they're still connected |
|
|
|
|
![](images/spacer.gif) |
Hackmaster
|
Posted: Mon Sep 24, 2007 6:44 pm Post subject: Re: Connect to more than two people? |
|
|
I wrote a multi-user chat client in Turing last year for my final exam. got 147%.
how do you do it? well, they guy just above me has it : array. make a variable that increments everytime you add a new user and add him on a new port. I would post the code, but I would rather you figure it out as opposed to copy/pasting and not having a clue.
HINT : you will need 2 separate programs : a server, and a client. you can give the clients out to multiple people, and you can run the server. it doesn't need to be able to talk, because you can just open the client in another window.
I made fun things for mine... the server could instantly close someone's window, it could boot, ban... IP ban... lots of fun
anyhow... good luck. people don't realize turing is powerful. it can do a hell of a lot, including objects, classes, and of course, networking... although I was never really happy with the networking. I was an advocate of Turing's networking ability until I discovered java's... however, it still works for your purposes ![Smile Smile](images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
allrace1337
|
Posted: Wed Sep 26, 2007 8:27 pm Post subject: RE:Connect to more than two people? |
|
|
I can't achieve great things in Turing. I fail. I wish I knew something better |
|
|
|
|
![](images/spacer.gif) |
Nick
![](http://compsci.ca/v3/uploads/user_avatars/19644337547e837b41d67a.png)
|
Posted: Wed Sep 26, 2007 8:30 pm Post subject: RE:Connect to more than two people? |
|
|
well if u stick with turing (although don't stick with it too long or u'll fear change) i bet u could acheive something better... however if you do wanna move on there are a lot of open source languages out there
examples:
ruby
java
C++(i beleive is open source someone correct me if im wrong)
and a lot more just keep trying and you will acheive great things |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
rdrake
![](http://compsci.ca/v3/uploads/user_avatars/113417932472fc6c9cd916.png)
|
Posted: Wed Sep 26, 2007 10:03 pm Post subject: Re: RE:Connect to more than two people? |
|
|
momop @ Wed Sep 26, 2007 8:30 pm wrote: ruby All implementations are open source.
momop @ Wed Sep 26, 2007 8:30 pm wrote: java I believe all implementations are open source.
momop @ Wed Sep 26, 2007 8:30 pm wrote: C++(i beleive is open source someone correct me if im wrong) Some compilers are open source, some are not. |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Thu Sep 27, 2007 4:04 am Post subject: Re: RE:Connect to more than two people? |
|
|
rdrake @ Thu Sep 27, 2007 11:03 am wrote: momop @ Wed Sep 26, 2007 8:30 pm wrote: java I believe all implementations are open source.
There are more Java implementations than you can imagine (or would want to, lest you stare too intently into the abyss). I wouldn't count on them all being open source. |
|
|
|
|
![](images/spacer.gif) |
|