multiple platforms socket c++

TinyTcp: This is a C++ socket library designed to fast development of socket related functionality.

參考
codeproject Multi-threaded-Client-Server-Socket-Class


https://github.com/paul999/433.92-Raspberry-Pi/blob/master/libs/socket.h
https://github.com/paul999/433.92-Raspberry-Pi/blob/master/libs/socket.c

1
2
3
4
5
6
7
8
9
10
11
12
13
struct socket_callback_t {
void (*client_connected_callback)(int);
void (*client_disconnected_callback)(int);
void (*client_data_callback)(int, char*);
};

int start_server(unsigned short port);
int connect_to_server(char *address, unsigned short port);
void socket_close(int i);
void socket_write(int sockfd, const char *msg, ...);
void socket_write_big(int sockfd, const char *msg, ...);
char *socket_read(int sockfd);
char *socket_read_big(int sockfd);

socket_read_big 可以看看
socket_write_big 可以看看


NetLink Sockets C++: chatClient.cc
NetLink Sockets C++: chatServer.cc

1
2
3
OnAccept onAccept;
OnRead onRead;
OnDisconnect onDisconnect;


The C++ Network Library Project
(A collection of open-source libraries for high level network programming.)
https://github.com/cpp-netlib/cpp-netlib


libusbmuxd (C 版本)

https://github.com/libimobiledevice/libusbmuxd/blob/master/common/socket.h
https://github.com/libimobiledevice/libusbmuxd/blob/master/common/socket.c
https://github.com/libimobiledevice/libusbmuxd/blob/master/common/collection.h
https://github.com/libimobiledevice/libusbmuxd/blob/master/common/collection.c
https://github.com/libimobiledevice/libusbmuxd/blob/master/src/libusbmuxd.c
https://github.com/libimobiledevice/usbmuxd/blob/master/src/main.c


Beej’s Guide to Network Programming 正體中文版: 06-Client-Server 基礎
boost asio examples
C++11 implementation of Socket.IO client
關閉Sockets不一樣 stackoverflow cross-platform-sockets
tiny cross-platform socket API library