Giter Site home page Giter Site logo

simplest_socket's Introduction

Simplest_Socket

Build Status

Introduction

Simplest_Socket是学习UNIX网络编程的入门首选,是网络编程领域的“Hello World”。

本项目基于Linux socket,实现两主机之间最简单的网络通信。客户端发送小写字符给服务端,服务端将其转为大写并回送给客户端。

Environment

  • OS:CentOS 7.5
  • Compiler:gcc 4.8
  • CMake:version 3.19.6
  • Make:GNU Make 3.82
  • Shell:GNU bash, version 4.2.46

Usage

clone

git clone https://github.com/mrxuxg/Simplest_Socket.git

build

cd Simplest_Socket
./build.sh

run

cd bin
./server 或 ./epoll_server
./client

开启两个shell,分别运行server和client。 注:epoll_server还存在一些问题:

  • 断开连接时提示的IP:Port是不对的。

communication

客户端

输入英文字符串
//Q表示退出

可以看到服务端显示客户端输入的英文字符串,并且客户端显示对应字符串的大写形式。

simplest_socket's People

Contributors

geeekpanda avatar

Stargazers

Coder-Goo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.