Socket APIs
|
SOCKET APIs Implements file. More...
#include "socket.h"
Go to the source code of this file.
Macros | |
#define | SOCK_ANY_PORT_NUM 0xC000; |
#define | CHECK_SOCKNUM() |
#define | CHECK_SOCKMODE(mode) |
#define | CHECK_SOCKINIT() |
#define | CHECK_SOCKDATA() |
Functions | |
int8_t | socket (uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag) |
Open a socket. More... | |
int8_t | close (uint8_t sn) |
Close a socket. More... | |
int8_t | listen (uint8_t sn) |
Listen to a connection request from a client. More... | |
int8_t | connect (uint8_t sn, uint8_t *addr, uint16_t port) |
Try to connect a server. More... | |
int8_t | disconnect (uint8_t sn) |
Try to disconnect a connection socket. More... | |
int32_t | send (uint8_t sn, uint8_t *buf, uint16_t len) |
Send data to the connected peer in TCP socket. More... | |
int32_t | recv (uint8_t sn, uint8_t *buf, uint16_t len) |
Receive data from the connected peer. More... | |
int32_t | sendto (uint8_t sn, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t port) |
Sends datagram to the peer with destination IP address and port number passed as parameter. More... | |
int32_t | recvfrom (uint8_t sn, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t *port) |
Receive datagram of UDP or MACRAW. More... | |
int8_t | ctlsocket (uint8_t sn, ctlsock_type cstype, void *arg) |
Control socket. More... | |
int8_t | setsockopt (uint8_t sn, sockopt_type sotype, void *arg) |
set socket options More... | |
int8_t | getsockopt (uint8_t sn, sockopt_type sotype, void *arg) |
get socket options More... | |
SOCKET APIs Implements file.
SOCKET APIs like as Berkeley Socket APIs.
Copyright (c) 2013, WIZnet Co., LTD. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file socket.c.
#define CHECK_SOCKNUM | ( | ) |
Definition at line 66 of file socket.c.
Referenced by close(), connect(), ctlsocket(), disconnect(), getsockopt(), listen(), recv(), recvfrom(), send(), sendto(), setsockopt(), and socket().
#define CHECK_SOCKMODE | ( | mode) |
Definition at line 71 of file socket.c.
Referenced by connect(), disconnect(), getsockopt(), listen(), recv(), send(), and setsockopt().
#define CHECK_SOCKINIT | ( | ) |