Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
(...) 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


In reply to Re: help for accept sys call by fokat
in thread help for accept sys call by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found