Berkeley CSUA MOTD:Entry 10819
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/24 [General] UID:1000 Activity:popular
5/24    

2003/10/28-29 [Computer/Networking] UID:10819 Activity:nil
10/27   Socket guy again: I need my module to attempt an auto-reconnect if
        a socket goes down (eg, shutdown() or close() by the other side, or
        maybe just the remote machine being switched off).  I've been trying
        to use select to detect either an invalid socket, or an exception
        on the socket, but I can't get any indication of the socket's
        non-existence until I actually try to send() on it (which fails and
        complains).  Is there some other property I should be checking on?
        Thanks
        \_ This is all theoretical so I hope it helps:  if you Ctrl-C
           on the remote side, the OS will send the TCP FIN type messages,
           so your local side should know.  If the remote computer is
           unplugged then you won't know until your local side wants to
           send something, and even then it will take a while for TCP to
           give up (like a minute?).  Finally, google for TCP keepalive.
           \_ If the remote side close()s or shutdown()s (or both), how
              do I detect that locally?
              \_ I'm not using select(), but it occurs when my next recv()
                 call returns 0.  My socket is in non-blocking mode.
                 \_ Thanks, I guess that's the only indication.
                    \_ Use select() with the socket in the read set.
                       If the socket is closed, you will get a read ready
                       on that socket.  Calling recv() on the socket
                       will return 0.
2025/05/24 [General] UID:1000 Activity:popular
5/24    

You may also be interested in these entries...
2007/11/30-12/6 [Computer/SW/Compilers, Computer/HW/CPU] UID:48719 Activity:moderate
11/29   From the CSUA minutes:
        - Next Gen Console
        -- If we have $1800 in our accounts, should we buy a console:
           4 votes passes.
        -- Console voting: 2 votes each, neither passes
           * 360 = 600, more games
	...
2007/11/27-30 [Computer/SW/Languages/C_Cplusplus, Computer/SW/OS/Solaris] UID:48701 Activity:high
11/27   I'm using select to do a nonblocking check to see if a single socket
        has anything to read off it.  Problem is, I can have up to 12228
        file descriptors, and Linux fd_set only supports up to 4096.  Any idea
        what I can do about this?  (Or a better solution?) -jrleek
        \- 1. who are you
           2. i am busy this week and you didnt mention language
	...
2007/11/13-21 [Computer/Networking] UID:48628 Activity:low
11/13   If I have a application on machine foo sending data really fast to
        an application on machine bar via TCP, and the bar applications job
        is write that to disk as fast as possible, what happens if the
        network stream is faster than the disk writes?
        \_ Look up the differences between TCP/IP flow control and
           congestion control. The answer is in front of you.
	...
2007/4/30-5/4 [Computer/SW/Languages/C_Cplusplus, Computer/SW/WWW/Server] UID:46485 Activity:nil
4/30    Technical question:
        I have a threaded webserver, one thread waits around and calls
        accept, then pulls threads out of a thread pool to handle the
        requests.  I want to be able to shut down the webserver cleanly, so
        I have the main thread wait for a signal to shutdown.  It then
        joins on the accept thread while the accept thread cleans up the
	...
2007/3/23-27 [Computer/SW/Security, Computer/SW/Unix] UID:46068 Activity:nil
3/23    hey root can you turn 'PINGS' to soda.csua back on?
        thanks
        \_ Hey, root, can you disable this h0zer's motd-editing cron-job pls?
        \_ and what's up with crippling traceroute?  It needs setuid to
            function.
            > traceroute scotch
	...
2006/11/3-4 [Computer/SW/WWW/Browsers] UID:45153 Activity:nil
11/3    In my WinSock.h for v1.1 (dated 6/4/02), there is this line:
                #define AF_FIREFOX      19              /* FireFox */
        What is that???  FireFox socket address family?
        \_ It is a hack MS put into the windows network stack back in '02 to
           slow down FireFox network connections.
	...
2006/10/12-14 [Computer/HW/CPU] UID:44789 Activity:nil
10/12   On a dual-processor PC, the two CPUs can concurrently run one thread
        and one interrupt handler, or two interrupt handlers.  Can a dual-core
        processor PC and a hyperthreading processor PC do the same things?
        Thanks.
        \_ Dual-core is basically dual processor sharing the same socket, so
           I don't see why not.  Hyperthreading is weird, I dunno.
	...
2006/7/26-28 [Science/GlobalWarming, Computer/HW/CPU] UID:43810 Activity:nil
7/26    Re the AMD price cuts Monday, http://newegg.com shows the Athlon X2 4600+
        Socket AM2 Windsor as $330 and out of stock, but http://mwave.com has it
        in stock for $240.  Also, the energy-efficient variants are only
        supposed to have a 10% mark-up, but no word on availability.
        Don't get screwed.
        \_ How much MORE efficient?
	...