c++ - 使用 UDP 连接到服务器

标签 c++ linux shell ubuntu

You are asked to develop a Floppy Disk Shell environment that allows users to access a floppy disk mounted on a remote computer. Your Floppy Disk Shell would give use an illusion that s/he is operating on a locally mounted floppy disk.

Required Modules:

Server daemon: a single threaded UDP Floppy Disk server, which accepts three API commands: Request for new connection. Request for data in a specific sector of the floppy disk. Request for disconnect. The server daemon should be able to handle up to 4 clients at the same time. If the 5th client tries to connect, it will be rejected.

Upon a successful connection, the client will receive a handle from the floppy server and use the handle as the reference in all future remote requests.

When a connected client requests for data or disconnection, the floppy daemon must check whether the client's handle is consistent with its port number and inet address associated. If not, the request will be rejected

我不是要求任何人解决这个问题,只是问是否有人可以提供一些我可以阅读的有用链接,因为我不知道从哪里开始......所以如果有人能告诉我从哪里开始,我将不胜感激:)

最佳答案

Beej's Guide to Network Programming是一个经常链接的网站。好不好不好说。

我自己在网上有任何教程之前,通过阅读大量代码、手册页和引用资料,艰难地学习了网络编程。最重要的是,进行大量实验。

关于c++ - 使用 UDP 连接到服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9493879/

相关文章:

C++从ifstream读取一个 block 并写入ofstream

c++ - 设置两个结构彼此相等后指针为 NULL

c++ - STL 算法如何独立于 Iterator 类型工作?

c++ - 命名空间到底是什么,为什么有必要

linux - 如何使用grep从txt文件中获取大于50的数字

linux - 如何在 shell 脚本中逐行从文件中分离关键字?

linux - 设置jenkins进程的umask

linux - 同一 sed 命令上的两个模式匹配

mysql - 如何使用mysql运行多个.sql文件?

javascript - 服务器端 Ajax 响应速度太慢(shell 脚本)