Stevens's Unix Network Programming is the classic. Any edition will do -- quite frankly the first is clearest. He gets coverage-happy (STREAMS, seriously?) in the 2nd and the 3rd (completed by another author after Stevens's death) is just plain too big.