如何在C中打开和使用套接字? [英] How to open and use a socket in C?

查看:162
本文介绍了如何在C中打开和使用套接字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道用C编程语言进行网络编程的最简单,最有效的方法,将数据打开和写入套接字.

I would like to know the simplest and most effective way to open and write data to a socket in the C programming language for network programming.

推荐答案

您是正确的,在C语言中使用套接字有困难的语法.相比之下,Java和Python等后来的语言使它变得轻而易举.我发现的使用C语言进行套接字编程的最佳教程是《 Beej网络指南》编程.我建议您从一开始就获得一个很好的概述,但是,如果您只需要在 now 上运行一些代码,则可以跳到标题为

You're right, using sockets in C has a difficult syntax. Later languages like Java and Python make it a snap by comparison. The best tutorial I've found for doing socket programming in C is Beej's Guide to Network Programming. I recommend you start at the beginning to get a good overview, but if you just need to get some code working now, you can skip ahead to the section titled Client-Server Background.

祝你好运!

这篇关于如何在C中打开和使用套接字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆