writev()

This is a discussion on writev() within the Linux Programming forums, part of the Platform Specific Boards category; I am trying to replace send() with writev() to eliminate a copy operation in the network code. I know with ...

  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, 06: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21