zenilib: zenilib/jni/external/sdl_net/SDLnetTCP.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
SDLnetTCP.c File Reference
`#include "SDLnetsys.h"`
`#include "SDL_net.h"`

Go to the source code of this file.

## Functions

TCPsocket | SDLNet_TCP_Accept (TCPsocket server)
void | SDLNet_TCP_Close (TCPsocket sock)
IPaddress * | SDLNet_TCP_GetPeerAddress (TCPsocket sock)
TCPsocket | SDLNet_TCP_Open (IPaddress *ip)
int | SDLNet_TCP_Recv (TCPsocket sock, void *data, int maxlen)
int | SDLNet_TCP_Send (TCPsocket sock, const void *datap, int len)

## Function Documentation

TCPsocket SDLNet_TCP_Accept | ( | TCPsocket | server | ) |

Definition at line 166 of file SDLnetTCP.c.

References INVALID_SOCKET, malloc, NULL, SDLNet_SetError(), SDLNet_TCP_Close(), and sock.

Referenced by Zeni::TCP_Listener::accept(), and HandleServer().

void SDLNet_TCP_Close | ( | TCPsocket | sock | ) |

Definition at line 289 of file SDLnetTCP.c.

References closesocket, free, INVALID_SOCKET, and NULL.

Referenced by cleanup(), HandleClient(), HandleServer(), main(), SDLNet_TCP_Accept(), SDLNet_TCP_Open(), Zeni::TCP_Socket::TCP_Socket(), Zeni::TCP_Listener::~TCP_Listener(), and Zeni::TCP_Socket::~TCP_Socket().

IPaddress* SDLNet_TCP_GetPeerAddress | ( | TCPsocket | sock | ) |

Definition at line 223 of file SDLnetTCP.c.

References NULL.

Referenced by HandleServer(), and Zeni::TCP_Socket::peer_address().

TCPsocket SDLNet_TCP_Open | ( | IPaddress * | ip | ) |

Definition at line 46 of file SDLnetTCP.c.

References IPaddress::host, INADDR_ANY, INADDR_NONE, INVALID_SOCKET, malloc, memset, NULL, IPaddress::port, SDLNet_SetError(), SDLNet_TCP_Close(), sock, and SOCKET_ERROR.

Referenced by main(), Zeni::TCP_Listener::TCP_Listener(), and Zeni::TCP_Socket::TCP_Socket().

int SDLNet_TCP_Recv | ( | TCPsocket | sock,
|  | void * | data,
|  | int | maxlen
| ) |  |

Definition at line 269 of file SDLnetTCP.c.

References SDLNet_GetLastError(), SDLNet_SetError(), and SDLNet_SetLastError().

Referenced by HandleClient(), HandleServer(), and Zeni::TCP_Socket::try_receive().

int SDLNet_TCP_Send | ( | TCPsocket | sock,
|  | const void * | datap,
|  | int | len
| ) |  |

Definition at line 236 of file SDLnetTCP.c.

References SDLNet_GetLastError(), SDLNet_SetError(), and SDLNet_SetLastError().

Referenced by HandleClient(), HandleServer(), SendHello(), SendNew(), and Zeni::TCP_Socket::try_send().