]>
Commit | Line | Data |
---|---|---|
d7ce7006 | 1 | /** @file\r |
2 | Implement the send API.\r | |
3 | \r | |
4 | Copyright (c) 2011, Intel Corporation\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #include <SocketInternals.h>\r | |
16 | \r | |
17 | \r | |
18 | /**\r | |
19 | Send data using a network connection.\r | |
20 | \r | |
21 | The ::send routine queues data to the network for transmission.\r | |
22 | The\r | |
23 | <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html">POSIX</a>\r | |
24 | documentation is available online.\r | |
25 | \r | |
26 | @param [in] s Socket file descriptor returned from ::socket.\r | |
27 | \r | |
28 | @param [in] buffer Address of a buffer containing the data to send.\r | |
7dc13291 | 29 | \r |
d7ce7006 | 30 | @param [in] length Length of the buffer in bytes.\r |
31 | \r | |
32 | @param [in] flags Message control flags\r | |
33 | \r | |
7dc13291 | 34 | @return ::send returns the number of data bytes that were\r |
d7ce7006 | 35 | sent and -1 when an error occurs. In the case of\r |
36 | an error, errno contains more details.\r | |
37 | \r | |
38 | **/\r | |
39 | ssize_t\r | |
40 | send (\r | |
41 | int s,\r | |
42 | CONST void * buffer,\r | |
43 | size_t length,\r | |
44 | int flags\r | |
45 | )\r | |
46 | {\r | |
d7ce7006 | 47 | //\r |
486aace4 | 48 | // Send the data\r |
d7ce7006 | 49 | //\r |
486aace4 | 50 | return sendto ( s, buffer, length, flags, NULL, 0 );\r |
d7ce7006 | 51 | }\r |