Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Sockets and threads, oh my!

by KevinZwack (Chaplain)
on Jun 19, 2006 at 21:07 UTC ( [id://556295]=note: print w/replies, xml ) Need Help??


in reply to Re: Sockets and threads, oh my!
in thread Sockets and threads, oh my!

I tried your modified code, but it still seems the function the same as before. I'm confused too, aren't sockets supposed to be full-duplex?

Unfortunately the motherboard on my laptop fried yesterday, so I won't be able to due further testing on Windows. I can continue development on my Solaris workstation for the next few weeks.

Regards,
Kevin Zwack

Replies are listed 'Best First'.
Re^3: Sockets and threads, oh my!
by BrowserUk (Patriarch) on Jun 19, 2006 at 21:44 UTC

    I can assure you that the code I posted works using AS811/AS817 under XP.

    As for the "full-duplex" thing, that is a confusing term when applied to communications over tcp connections. Both ends can transmit simultaneuosly because the buffering and handshaking (ack & nacks) are taken care of at the ip level. Whether one end can both send and receive simultaneously on different threads really depends upon the implementation.

    What I can tell you is that under XP, if the socket is in blocking mode, attempts to send and receive are serialised by the runtime. Ie. If one thread is currently in a blocking read, no other thread will be able to send until the read is satisfied or it times out. In non-blocking mode, the same is true, but if you use sysread, it will only fetch however much is currently available at the interface and return immediately. Even if nothing is available. The error code I mention in the code indicates that an incomplete read has returned early.

    Whether sockets operate this way on other platforms I do not know.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      That's strange, I copied and pasted your new code but still had the problem. I'll try again in a few weeks, I'm waiting for a new motherboard for my laptop. Thanks again for all your help.

      Regards,
      Kevin Zwack

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://556295]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found