- 博客(12)
- 资源 (17)
- 收藏
- 关注
原创 socket C/C++编程(11)windows client端使用ip,port,通过connect()连接上linux server
1. windows client 端代码 (test.cpp)#include <windows.h>#include <stdio.h>int main(int argc, char *argv[]){ // 初始化”ws2_32.lib” WSADATA ws; WSAStartup(MAKEWORD(2,2), &ws); // 创建client端的SOCKET
2017-08-22 15:17:23 1761
原创 socket C/C++编程(10)linux server端面向对象化处理
1. 面向过程的源代码如下,#include <stdio.h>#include <string.h>#include <thread>#ifdef WIN32 #include <windows.h> #define socklen_t int#else #include <sys/types.h> #include <sys/socket.h> #i
2017-08-21 10:59:40 346
原创 socket C/C++编程(9)windows server端面向对象化处理
1. 面向过程的源代码如下,#include <stdio.h>#include <string.h>#include <thread>#ifdef WIN32 #include <windows.h> #define socklen_t int#else #include <sys/types.h> #include <sys/socket.h> #i
2017-08-19 11:17:55 409
原创 socket C/C++编程(8)server端多线程处理clients队列
1. 采用C++11的标准线程库(linux之pthread为例)实现多线程(test.cpp)#include <stdio.h>#include <string.h>#ifdef WIN32 #include <windows.h>#else #include <sys/types.h> #include <sys/socket.h> #include <un
2017-08-17 14:33:39 2291 1
原创 socket C/C++编程(7)server端读取client端键入的数据
1. 服务器读取一次客户端编辑发送的数据#ifdef WIN32 #include <windows.h>#else #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h>#endif
2017-08-16 09:46:20 2292
原创 socket C/C++编程(6)server之accept()函数创建新socket以单独读取缓存区某个client的连接信息(客户端的IP和端口,但是,不包括client端键入的数据)
1. 首先 第一类服务器socket是用于绑定某个服务器端口,第二类服务器socket用于绑定交互(读写)某个listen()缓冲区的client。2. 代码 accept()函数创建新socket以单独读取缓存区某个client的连接信息(IP和端口,不包括客户端编辑发送的数据)。第二类读取某个client交互信息的socket不关闭的代码如下,#ifdef WIN32 #includ
2017-08-15 17:01:00 1930 1
原创 socket C/C++编程(5)服务器端允许用户连接之listen()函数
1. Linux server端代码(test.cpp)#ifdef WIN32 #include <windows.h>#else #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h>
2017-08-15 13:21:28 1004
原创 socket C/C++编程(4)Server端向OS请求sockets资源进行server端开放端口号的绑定
1. Linux server端代码(test.cpp) #ifdef WIN32 #include <windows.h>#else #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <stdlib.h> #include <arpa/inet.h
2017-08-15 13:15:37 353
原创 socket C/C++编程(3)Windows&Linux之socket兼容性编程
1. Windows socket依赖库”ws2_32.lib”编译1.0. 创建工程 VS2012创建VC++“win32”空项目到共享目录\192.168.1.100\sharedcode 1.1. 加载windows 网络库”ws2_32.lib”点击“项目”,右键“属性”,选中“链接器”,选中“输入”, 附加依赖项目的最前面添加 ”ws2_32.lib”,保存1.2. 添加新
2017-08-11 17:26:29 1333
原创 socket C/C++编程(2)Samba工具——将Windows本地文件 Automatically 同步到Linux上(反之亦成立)
1. Linux端之Samba工具的介绍及安装实现Windows主机与Linux服务器之间的资源共享,Linux操作系统提供了Samba服务,Samba服务为两种不同的操作系统架起了一座桥梁,使Linux系统和Windows系统之间能够实现互相通信。安装sudo apt-get install samba配置sudo vim /etc/samba/smb.conf尾行添加配置项(以“/home/jo
2017-08-11 12:58:36 1190
原创 CUDA(34)之算数加法
1. CPU端(程序:cpu.c)#include <stdio.h>#define N 10void add(int *a, int *b, int *c){ int tid = 0; while(tid < N){ c[tid] = a[tid] + b[tid]; tid++; }}int main(){ int a[N], b
2017-08-06 16:08:04 745
hyperledger-fabric-readthedocs-io-en-v2.2.1.pdf
2021-01-27
LibreOffice Draw 之网络图示模板 VRTnetworkequipment_1.2.0-lo
2018-08-01
1999年到2018年香港房地产走势数据
2018-04-02
GeoIP Databases of Country and City
2017-06-06
Performance analysis of the Blockchain
2017-01-19
An introduction to Blockchain that is a supporting technology of Bitcoin.
2017-01-03
Linux Kervel Version 1.0 (open source)
2017-01-03
GPU与MATLAB混合编程之书本实现代码
2016-07-15
Totem拓扑数据
2016-05-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人