Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ Programming
➜ General
➜ Load testing script or program.
Load testing script or program.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #15 on Thu 05 Jun 2008 09:40 AM (UTC) |
Message
| You need strategies to deal with this sort of situation. Looking at the documentation for luasocket, it says under "connect":
In case of error, the method returns nil followed by a string describing the error. In case of success, the method returns 1.
That is a hint that you can use "assert" here with success. That is:
local conn = assert (socket.connect (host, port))
Now without the assert, if I try my suggested code with an invalid port number, I see what you see:
lua: stresstest.lua:7: attempt to index local 'conn' (a nil value)
stack traceback:
stresstest.lua:7: in main chunk
[C]: ?
That means there is an error message lurking there.
Now with the assert there I see:
lua: stresstest.lua:5: connection refused
stack traceback:
[C]: in function 'assert'
stresstest.lua:5: in main chunk
[C]: ?
OK, "connection refused". That means either the wrong port, the wrong server, or the MUD isn't up. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Robert Powell
Australia (367 posts) Bio
|
Date
| Reply #16 on Thu 05 Jun 2008 09:46 AM (UTC) |
Message
| I was just going through tinyclient code, its pretty neat, simple and even i can work out whats going on.
I think i might spend a few days playing with it and see what i can come up with. |
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | Top |
|
Posted by
| Robert Powell
Australia (367 posts) Bio
|
Date
| Reply #17 on Thu 05 Jun 2008 09:57 AM (UTC) |
Message
| Ok nick i got it working, actually it works a treat, and it was my mistake earlier also, because i killed of kdevelop and it was in a konsole in kdevelop that i had the server running.
Rebooted the server and it it ran perfectly. Now i need to install lua and luasocket on my server and start to create a heap of scripts to use for testing. |
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
55,932 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top