Linux C / C ++ UDP套接字 [英] Linux C/C++ UDP sockets

查看:89
本文介绍了Linux C / C ++ UDP套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想通过互联网在C上发送一个数据包或一个字符串,

我在不同论坛上提出的大部分问题都没有真正帮助,

所以我使用了一些网页上的东西,可以帮助人们帮助我。



您可以下载文件:

此处 [ ^ ]



我发现它的地方:

这里 [ ^ ]



我的尝试:



在下载文件中我试图使用udp-send.c但是我想通过互联网发送一些东西,这样只能是合乎逻辑的东西。



它给我的错误:



Hello, I want to send a packet or a string over the internet in C,
and most of my questions that i have asked on diffrent forum just don't really help,
so i have used something from a webpage that maybe can help ppl help me.

You can download the file:
Here[^]

And the place i found it on:
Here[^]

What I have tried:

in the download file i tried to use the udp-send.c Becuse i want to send something over the internet so that can only be the logical thing.

The Error it have me:

udp-send.c: In function ‘int main()’:
udp-send.c:26:17: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
  char *server = "xxx.xx.xx.xx"; /* change this to use a different server */
                 ^
udp-send.c:53:41: error: ‘inet_aton’ was not declared in this scope
  if (inet_aton(server, &remaddr.sin_addr)==0) {
                                         ^
udp-send.c:66:10: error: ‘close’ was not declared in this scope
  close(fd);
          ^

推荐答案

您已经在如何在C [LINUX]中使用UDP套接字 [ ^ ]并收到反馈。请不要重新发布。
You already posted this question at How do I use UDP sockets in C [LINUX][^] and received feedback. Please do not repost.


这篇关于Linux C / C ++ UDP套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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