I'm having a hard time guessing what module accept() is a method of. Can you tell us so that we (I) can read the module's POD to see if an answer lies within?
Also, what exactly do you mean by "some junk value"? That may be valuable information (and then again it may not, but until we see we won't know).
Ready to try to find an answer...
| [reply] [d/l] |
I'm having a hard time guessing what module accept() is a method of. Can you tell us so that we (I) can read the module's POD to see if an answer lies within?
perldoc -tf accept says (since it is a core operator):
accept NEWSOCKET,GENERICSOCKET
Accepts an incoming socket connect, just as the accept(2)
+system
call does. Returns the packed address if it succeeded, fal
+se
otherwise. See the example in "Sockets: Client/Server
Communication" in perlipc.
On systems that support a close-on-exec flag on files, the
+ flag
will be set for the newly opened file descriptor, as deter
+mined
by the value of $^F. See "$^F" in perlvar.
| [reply] [d/l] |
Thanks merlyn. :) It looked to me like an object method so I went diving into CPAN to figure out what module it might be.
So now I have a question which isn't evident in perlfunc: What's going on with the usage in this OP's example? It looks to me like accept() is being used as an object method, which means that the first argument passed to accept() will be the object's reference, rather than NEWSOCKET. I've probably missed something else elementary, but a little clarification would set my mind at ease. :)
Or is it possible that accept() is a method of some module, and not the core builtin?
| [reply] [d/l] [select] |
(...) but many a times it returns some junk value. i do not know how is thsi happening.
And what is $GLOBAL_SERVER? What is that "junk value" that is being returned? I will assume that ->accept() is calling the perl's builtin accept().
If this supposition is correct, this snippet from perldoc -f accept might be enlightening:
accept NEWSOCKET,GENERICSOCKET
Accepts an incoming socket connect, just as the accept(2) sys-
tem call does. Returns the packed address if it succeeded,
false otherwise. See the example in "Sockets: Client/Server
Communication" in perlipc.
This "junk" could be the packed address of the client connecting to your socket. On the other hand, this might be IO::Socket->accept() instead of the builtin, so the earlier snippet would not apply directly...
Note that accept() can be interrupted by signals, so it may be returning undef. In any case, please provide a bit more of detail, so that we can properly help you.
Best regards
-lem, but some call me fokat
| [reply] |
actually this returns string like
test0001 passed
but many times it also returns
testebug failed .
actually it shouls return status of test just like in first case. when i submit tests like test0001 after they are complated it returns its status along with test name but i am wondering when i am not submitting any test case like testebug why it is returning it.
| [reply] |