About Store Forum Documentation Contact



Post Reply 
Connection 2 code
Author Message
fuzzylr Offline
Member

Post: #1
Connection 2 code
I have been monkeying around with the code a bit trying to learn. I traced back some of the functions. I am trying to set a static IP for the server and the port it listens on. Every time I try to set the ip I encounter issues. Any suggestions would be helpful.

Code:
sockAddr server_addr;
   //server_addr.setLocal(65535);
   server_addr.setIP(192168023, 65535);
   if(!Server.clientConnectToServer(server_addr))Exit("Can't connect to Server");

This works but the client sorta hangs.

I am trying to do this on the lan. However, I would like somebody to connect over the network. I also can't seem to find the code where the server is actually listening. Well, it's definition anyways.

Fuzzy
Student|Westwood
Project V. Studios | Game Dev
(This post was last modified: 02-14-2013 07:03 AM by fuzzylr.)
02-14-2013 06:46 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Connection 2 code
It can freeze if the server address is invalid.
There are 2 tutorials using Connection class in the EE 2.0ttutorials project.
Look for network folder, connection client server apps
02-14-2013 10:19 AM
Find all posts by this user Quote this message in a reply
fuzzylr Offline
Member

Post: #3
RE: Connection 2 code
(02-14-2013 10:19 AM)Esenthel Wrote:  It can freeze if the server address is invalid.
There are 2 tutorials using Connection class in the EE 2.0ttutorials project.
Look for network folder, connection client server apps

I am using the connection two tutorial. None of your tutorials actually demonstrate how to get the client server to listen. I will play with it some more. I am going to test out of my Intro to programming class and hopefully I can move onto the more advanced classes.

Fuzzy
Student|Westwood
Project V. Studios | Game Dev
02-15-2013 03:33 AM
Find all posts by this user Quote this message in a reply
xzessmedia Offline
Member

Post: #4
RE: Connection 2 code
Fuzzylr why dont you buy ineisis Source? Its very helpful and contains all sorts of Code including listening Server.
For me it was definately worth the money

Royality Free Game Ressources
www.xzessmedia.de
02-15-2013 04:38 AM
Find all posts by this user Quote this message in a reply
fuzzylr Offline
Member

Post: #5
RE: Connection 2 code
Actually, I figured it out. You know Esenthel you could have cut the thread in half if you had said that it was assumed that all String were wrapped in ""'s...LoL

The correct code is as follows.

Code:
SockAddr server_addr;
  
   server_addr.setIP("98.163.65.32", 65535);
   //server_addr.setLocal(65535);

I'd like to thank aceio76 for showing me how much of a idiot I was being when I missed the reference to it being a string.

Also aceio76 shared me how to display the server IP and port. I'd like to share that code with you so you have it. Thanks again to aceio76 for one of his excellent explanations.

Connection 2 (Esenthel 2.0) void draw()

Code:
D.text(0, 0.6f, S+"Local Address: " +Server.addressLocal ().asText());

Oh, hey thanks for publishing 2.0 beta with a x64 bit client. That has helped out a lot. No more crashes.

Fuzzy
Student|Westwood
Project V. Studios | Game Dev
(This post was last modified: 02-16-2013 12:20 AM by fuzzylr.)
02-16-2013 12:19 AM
Find all posts by this user Quote this message in a reply
Post Reply