Crystal Space
Welcome, Guest. Please login or register.
October 24, 2014, 08:28:45 am

Login with username, password and session length
Search:     Advanced search
9010 Posts in 2044 Topics by 8809 Members
Latest Member: Kaciejacobs
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  nettest
« previous next »
Pages: [1] Print
Author Topic: nettest  (Read 1761 times)
Phorem
Newbie
*
Posts: 22


View Profile
« on: October 24, 2006, 10:13:47 pm »

I know this question (or the generalized question about networking) has been asked but i have a quick one.

I have been trying for a while to see if i can get networking going. Like most others, i hadn't realized that i needed HawkNL to test the cel app.

I downloaded, built and installed Hawk and rebuilt cel. The nettest module works fine - well almost - for example purposes to get me started but i have a quick question.

This is what i have done....

Start the server:

./nettest -server -path=lev/terrainf -file=world

After this has started, the CPU usage goes through the roof. It's at a 100%.

Next i connect the client:

./nettest -client -player=Marc -serverhost=127.0.0.1

All seems to go well and i can use the F1 and F2 tests as well. However, not been an expert at C++ i can't seem to find the reason why the CPU is at 100% on the server side.
The ping lists as the dreaded 999 - however, i can still move and eventually information is displayed. But the 100% CPU thing is killing me.

The code i am using is all recent SVN pulls from the last week.

Is this a known issue?? I know the code for the nettest is "as is" but i was wondering where i might have a look or what tool i might use to fix the problem (possibly Valgrind)?

Thanks.
Phorem.

Edit - I should also mention i am using Linux 32bit with an ATI card (Laptop). The Hawk lib is 1.7b. All of CS and CEL is from SVN last week.
« Last Edit: October 24, 2006, 10:16:07 pm by Phorem » Logged
darek
Guest


Email
« Reply #1 on: October 25, 2006, 07:49:53 am »

you don't need default opengl driver there then run server with --video=null
Logged
Phorem
Newbie
*
Posts: 22


View Profile
« Reply #2 on: October 25, 2006, 06:04:44 pm »

I tried that, still at 100%. I guess i will have to look harder to why 100% of the processor is needed to run a couple tcp sockets smiley
Logged
bookeater
Newbie
*
Posts: 7


View Profile WWW Email
« Reply #3 on: October 25, 2006, 07:29:32 pm »

Though it may not help, you may want to see my example in this thread:
http://community.crystalspace3d.org/forum/index.php/topic,1236.msg5716.html#msg5716
Logged

rvhaasen
Jr. Member
**
Posts: 62


View Profile
« Reply #4 on: October 25, 2006, 11:10:49 pm »

Hi
i noticed this behaviour from the testprogram that comes with the HawkNL package, namely with the Test_clientserver test.

The server thread of this test program polls the socketgroup with a timeout of 0
Code:
        count = nlPollGroup(group, NL_READ_STATUS, s, MAX_CLIENTS, 0);
This causes a 100% cpu load of the server thread
If the timeout is changed to e.g. 1 (specified in msec) the cpu-load will drop
Code:
        count = nlPollGroup(group, NL_READ_STATUS, s, MAX_CLIENTS, 1);

So check the CEL net-testcode for the nlPollGroup method...
Rick
 
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 7.055 seconds with 15 queries.