应用背景学习一下套接字,很简单的例子,客户端与服务器端的简单编程,入门级别。Windows有专门的API函数,明白流程后直接一步一步调用函数就可以了关键技术服务器端步骤:1、创建用于监听的套接字(socket)2、将套接字绑定到本地地址和端口上(bind)3、将套接字设为监听模式(listen)4、等待客户请求(accept),此处要不断的调用accept5、通信(send...">
Home » Source Code » C/S SOCKET

C/S SOCKET

shangcodeforge
2015-09-17 03:31:44
The author
View(s):
Download(s): 0
Point (s): 1 
Category Category:
TCP/IP协议TCP/IP协议 CPlusPlus, C-C++C++

Description

size:16px;">应用背景

学习一下套接字,很简单的例子,客户端与服务器端的简单编程,入门级别。Windows有专门的API函数,明白流程后直接一步一步调用函数就可以了

关键技术

服务器端步骤:

1、创建用于监听的套接字(socket)

2、将套接字绑定到本地地址和端口上(bind)

3、将套接字设为监听模式(listen)

4、等待客户请求(accept),此处要不断的调用accept

5、通信(send/receive),完成后返回4

6、关闭套接字(closesocket)

 

客户端步骤:

1、创建套接字

2、向服务器发送连接请求(connect)

3、通信(send/recv)

4、关闭套接字

Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
Client.cpp536.00 B03-08-15|13:10
CLientNet.cpp3.14 kB06-08-15|17:51
ClientNet.h433.00 B03-08-15|13:08
Server.cpp275.00 B03-08-15|15:45
ServerNet.cpp3.34 kB03-08-15|16:38
ServerNet.h256.00 B03-08-15|14:47
客户端.txt269.00 B06-08-15|17:50
服务器.txt541.00 B06-08-15|17:50
socket0.00 B06-08-15|17:53
...
Sponsored links

Comments

(Add your comment, get 0.1 Point)
Minimum:15 words, Maximum:160 words
  • 1
  • Page 1
  • Total 1

C/S SOCKET (5.58 kB)

Need 1 Point(s)
Your Point (s)

Your Point isn't enough.

Get 22 Point immediately by PayPal

Point will be added to your account automatically after the transaction.

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more Points

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D