zoukankan      html  css  js  c++  java
  • 学习笔记之windows 网络编程

    WinSock2.h编程接口笔记
    在Qtcreater中使用系统默认的库只需要在.pro文件中添加

    LIBS += -lws2_32
    添加头文件
    #include <WinSock2.h 1

    /*服务端socket tcp 流程 2
    *
    3
    *初始化套接字 WSAStartup()

    4

    *创建套接字 socket()
     5     *
     6     *套接字与本地地址绑定 bind()
     7     *
     8     *监听客户端连接请求 listen()
     9     *等待客户端链接到达。。。
    特别注意:accetp()函数的返回值是一个新的套接字,进行数据收发使用
    因此,服务端有两个套接字,而客户端只有一个套接字
    10 * 接收连接请求,新建套接字accept() 11 * 数据收发 send()/recv() 12 * 13 * 断开本地连接 shutdown() 14 * 回到监听状态 15 * 关闭连接套接字 closesocket() 16 */ 17 18 /*客户端流程 19 * 初始化套接字 WSAStartup() 20 * 创建套接字 socket() 21 * 22 * 连接服务器 connect() 23 * 数据收发 send()/recv() 24 * 25 * 断开本地连接 shutdown() 26 * 关闭连接套接字 closesocket() 27 */
    
    

     postgresql数据库连接被拒绝,由于服务未开启的原因:

      win+r上输入services.msc打开服务队列,将postgresql设置为自动开启即可。

     
    
    
    



  • 相关阅读:
    Python2 cmp() 函数
    Python round() 函数
    Python floor() 函数
    Python ceil() 函数
    Python abs() 函数
    Python oct() 函数
    Python ord() 函数
    Python hex() 函数
    Python2 unichr() 函数
    Android--------工具类StatusBarUtil实现完美状态栏
  • 原文地址:https://www.cnblogs.com/luoyankuan/p/10643853.html
Copyright © 2011-2022 走看看