标准网络方法 [英] Standard network method

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

问题描述



我想要一种通过网络进行通信的方式,这种方式不依赖于b
特定于供应商的库,最好是同时适用于这两种库windows和

linux(理想的解决方案是在windows和linux上编译,

但是绝对理想的解决方案是一个也可以启用windows的

实时与* linux进行通信*,但这仍然是梦想......)

没有什么太花哨的,数据量不会很大。只需在特定端口上打开

连接,向下发送一些数据,关闭。并从另一端收到




即是否有标准的库函数...?我正在考虑沿着fopen(),fread(),.....的

行,是否有f_tcp()?


可以是C或C ++。

Hi
I''d like a way of communicating over a network that doesn''t rely on
vendor-specific libraries, preferably that will work on both windows and
linux (the ideal solution would be one that compiles on windows and linux,
but the absolute ideal one would be one that also enables windows to
communicate *with* linux in realtime, but that''s a pipe dream as yet...)
Nothing too fancy, the amounts of data won''t be great. Just open a
connection on a specific port, send some data down it, close. And receive
from the other end.

i.e. is there a standard library function for it...? I''m thinking along the
lines of fopen(), fread(), ..... , is there an f_tcp() ?

Can be either in C or C++.

推荐答案

使用(TCP-)套接字。


Bonj写道:
use (TCP-)sockets.

Bonj wrote:

我想要一种通过网络进行通信的方式,这种方式不依赖于特定于供应商的库,最好是可行的在windows和
linux上(理想的解决方案是在windows和linux上编译,但是绝对理想的解决方案是使Windows能够与* linux进行通信)实时,但那是一个梦想......但是没有什么太花哨的,数据量不会很大。只需在特定端口上打开
连接,向下发送一些数据,关闭。从另一端收到


即是否有标准的库函数...?我正在考虑fopen(),fread(),.....的行,是否有f_tcp()?

可以是C或C ++。
Hi
I''d like a way of communicating over a network that doesn''t rely on
vendor-specific libraries, preferably that will work on both windows and
linux (the ideal solution would be one that compiles on windows and linux,
but the absolute ideal one would be one that also enables windows to
communicate *with* linux in realtime, but that''s a pipe dream as yet...)
Nothing too fancy, the amounts of data won''t be great. Just open a
connection on a specific port, send some data down it, close. And receive
from the other end.

i.e. is there a standard library function for it...? I''m thinking along
the lines of fopen(), fread(), ..... , is there an f_tcp() ?

Can be either in C or C++.






Bonj写道:

我想要一种沟通方式网络不依赖于供应商特定的库,


然后你有一个问题。

最好能在两个窗口上工作和linux(理想的解决方案是在windows和linux上编译的那个,但是绝对理想的解决方案是使Windows能够实时与* linux进行通信,但是这是一个梦想......但是没有什么太花哨的,数据量不会很大。只需在特定端口上打开
连接,向下发送一些数据,关闭。从另一端收到


即是否有标准的库函数...?我正在考虑fopen(),fread(),.....的行,是否有f_tcp()?

可以是C或C ++。
Hi
I''d like a way of communicating over a network that doesn''t rely on
vendor-specific libraries,
Then you have a problem.
preferably that will work on both windows and
linux (the ideal solution would be one that compiles on windows and linux,
but the absolute ideal one would be one that also enables windows to
communicate *with* linux in realtime, but that''s a pipe dream as yet...)
Nothing too fancy, the amounts of data won''t be great. Just open a
connection on a specific port, send some data down it, close. And receive
from the other end.

i.e. is there a standard library function for it...? I''m thinking along the
lines of fopen(), fread(), ..... , is there an f_tcp() ?

Can be either in C or C++.




C中不存在任何类似内容。您需要找到第三方

库移植到您感兴趣的所有系统或写自己的。


< OT>

Windows和* nix之间有很多共性,因为基于MS

他们在BSD套接字上的TCP / IP库。所以写一些薄包装纸就不那么难了。但是,你如何进行网络连接不在这里,

所以请询问网络和/或系统特定组的详细信息。

< / OT>


任何C ++答案都是comp.lang.c中的主题,所以如果

发布C ++答案,请将其取消。

-

Flash Gordon

生活在有趣的时代。

虽然我的电子邮件地址说垃圾邮件,但它是真实的,我读了它。



Nothing like that exists in C. You either need to find a third party
library ported to all the systems you are interested in or write your own.

<OT>
There is a lot of commonality between Windows and *nix, since MS based
their TCP/IP library on BSD Sockets. So writing some thin wrappers is
not that difficult. However, how you do networking is not on topic here,
so ask for details in networking and/or system specific groups.
</OT>

Any C++ answers are off topic in comp.lang.c, so please take it off if
posting a C++ answer.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.


Bonj写道:
即是否有标准的库函数...?我正在考虑沿着fopen(),fread(),.....行的
,是否有f_tcp()?

可以是C或C ++。
i.e. is there a standard library function for it...? I''m thinking along the lines of fopen(), fread(), ..... , is there an f_tcp() ?

Can be either in C or C++.




C或C ++中的套接字没有标准库支持。

Boost也不支持套接字。


有些套接字库声称可以移植到许多

平台,但它们不是标准的。


-

Dave O'Hearn



There is no standard library support for sockets in either C or C++.
Boost does not support sockets yet either.

There are some sockets libraries that claim to be portable to many
platforms, but they are not standard.

--
Dave O''Hearn


这篇关于标准网络方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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