Thread: writev()

  1. #1
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446

    writev()

    I am trying to replace send() with writev() to eliminate a copy operation in the network code. I know with send there needs to be logic for partial writes, is this also true for writev? Are there any guarantees about an entire iov block being written at each write? It seems like the code for partial writes on a writev would be alot more complex than the basic loop that can be used for a send...

    Thanks for any info.

  2. #2
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    This is for many unixes, so I don't think sendfile is an option. The data that is being sent is from data structures built up in memory. I didn't realize that send (or writev) would send all data if you have it in blocking mode. Is this documented somewhere? Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using asynchoronous I/O : readv and writev
    By rak1986 in forum Linux Programming
    Replies: 1
    Last Post: 10-07-2008, 05:11 AM
  2. Using writev() instead of write() on sockets?
    By cpjust in forum C Programming
    Replies: 0
    Last Post: 11-22-2007, 02:11 PM