Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help With Online Master Server
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
copthesaint




PostPosted: Sun Mar 22, 2009 5:04 pm   Post subject: Help With Online Master Server

Ok Here are my 2 first programs That I had made, and it worked the first time I did this.(without arrays/processes)
But now My Server doesn't seem to send the welcome text which is ("Welcome To CopTheSaints Server.Please Enter your User Name" : Line (31 Master Server.t))
Is this just not working because I didn't use arrays for the client or what? Please Help if you can or enlighten me.



Online Game.zip
 Description:

Download
 Filename:  Online Game.zip
 Filesize:  681.67 KB
 Downloaded:  94 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tallguy




PostPosted: Mon Mar 23, 2009 9:04 am   Post subject: RE:Help With Online Master Server

ummm, it works for me...or maybe i'm not understanding your problem..that may be it,

is it your 'Master Server.t' thats not working?

because sometimes it says "Welcome To CopTheSaints Server.Please Enter your User Name", sometimes it doesn't, i don't really know why its doing it though . . . .
copthesaint




PostPosted: Mon Mar 23, 2009 8:30 pm   Post subject: Re: Help With Online Master Server

Hmm Here is a newer version I was working on but I keep getting runtine errors. anyone wanna see whats wrong?
It's will run fine untill it gives me this weird never seen before error. The error will tell you that line 24 is having an error.

Windows Socket Libary Error % 10048'.


(Btw there will be a pause connecting to the the program.)
Also if you o fix it post the code please. I am not going to be graded on this project.



Online Game.zip
 Description:

Download
 Filename:  Online Game.zip
 Filesize:  649.09 KB
 Downloaded:  76 Time(s)

copthesaint




PostPosted: Tue Mar 24, 2009 6:55 pm   Post subject: RE:Help With Online Master Server

Can someone please help me....
DemonWasp




PostPosted: Tue Mar 24, 2009 10:09 pm   Post subject: RE:Help With Online Master Server

Google will point you here: http://msdn.microsoft.com/en-us/library/ms740668(VS.85).aspx

Basically, what that error means is that something on your system has already claimed that port. Assuming you chose something over 1024, try closing Turing and retrying. If not, check your code to see if you're trying to listen again on the same socket (ip, port).
copthesaint




PostPosted: Tue Mar 24, 2009 10:42 pm   Post subject: RE:Help With Online Master Server

Ohh! I need to change the port for every client ! thanks demon for url
Ill see if this works
DemonWasp




PostPosted: Wed Mar 25, 2009 12:15 am   Post subject: RE:Help With Online Master Server

Actually, there's another solution that works better for multiple clients, but it's slightly more complex.

See, the thing is, for a server you want it to always be listening on the same port. So ideally, it shouldn't have to change ports for different players - they always connect to SERVER_LISTEN_PORT or whatever. It's possible to do this, and it goes like this:

1. Listen on SERVER_LISTEN_PORT
2. When you get a connection, immediately send another (unused) port number and close the connection.
3. Listen on the port mentioned in step 2.
4. When you connect on that port, start sending data to that client however you will. Meanwhile, return to step 1.

This isn't perfect (real networking solutions do it better...) but it's the best you're likely to get in Turing.
copthesaint




PostPosted: Wed Mar 25, 2009 11:48 pm   Post subject: RE:Help With Online Master Server

Well I didn't do what you are were saying but I got a working server made. I will post again when I have another problem or error.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: