套接字编程 [英] Socket Programming

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

问题描述

hi

我想为c/c ++编写用于IPv4协议的套接字程序.
但是我不知道如何开始以及从哪里开始.我在google上搜索了很多示例或给出的帮助,对我没有用..

如果您有任何知识或帮助.
关于上述问题,请帮我...

谢谢与问候
Nidhi

[edit date ="30/12/2010"]

Windows xp ...我需要将我的TCP/IP套接字转换为IPv4套接字..

这意味着我在局域网中使用的代码可以在局域网和广域网之间使用吗?
[/edit]

解决方案

Nidhi,

请参考此链接.

http://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancedcode1a.html


该示例 [ ^ ].但是请注意,IPv4不是协议,而只是IP地址的标准格式.套接字编程不依赖于IPv4或IPv6,在两种情况下都适用相同的基本规则.


请参考我先前的回答中的链接.转到该网页,阅读文章并使用提供的代码示例;他们提供解决问题所需的一切.


hi

I want to write a program for sockets in c/c++ for IPv4 protocol.
but I''m not able understand how to start and where to start.I have searched google a lot example or help given their,is not useful for me..

If anyone of you have any knowledge or any help.
Please help me regarding above problem...

Thanks and Regards
Nidhi

[edit date="30/12/2010"]

Windows xp... I need to convert my TCP/IP socket to IPv4 socket..

Hi this means that the code which i used in my lan can be used in between a lan and a wan?
[/edit]

解决方案

Hi Nidhi,

Please refer this link.

http://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancedcode1a.html


A Google search for "socket program" will reveal many samples including this one[^]. But note that IPv4 is not a protocol, merely a standard format for IP addresses. Socket programming is not dependent on IPv4 or IPv6, the same basic rules apply in either case.


Please refer to the link in my previous answer. Go to that web page, read the article and use the code samples provided; they give everything you need to resolve your issue.


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

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