如何将一个应用程序生成的数据发送到另一台服务器? [英] how to send data generated by one application to another server?

查看:99
本文介绍了如何将一个应用程序生成的数据发送到另一台服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我已经在VC ++ CLR中创建了一个application.exe,可以通过API从服务器A接收实时数据...现在我需要将实时数据发送到另一台服务器B,但是没有该服务器的DLL和API,我得到了我必须发送实时数据的服务器的仅IP,端口,用户名,密码,这是我第一次执行此类程序,因此我可能很傻,但我有点困惑,我们可以在没有api和dll的情况下进行连接

hello,
i have created an application.exe in VC++ CLR which could receive live data from server A, via the API...now i need to send the live data to another server B but dont have the DLL and API of that server,i got only IP,PORT,username,password of the server where i have to send the live data,this is the first time im doing this kind of program so i may be silly but im kind of confuse,can we connect without having api and dll??can anybody help or suggest me in this?

推荐答案

您必须了解的第一件事是服务器使用的协议.如果它是HTTP之类的通用库,则可以使用现成的库,例如 wininet [ libcurl [ ^ ]为您开展业务.

如果它是专有协议或您指定的协议,那么您将不得不走得更远.有一个用于联网的常规API:WINSOCK.DLL中包含套接字和基于TCP/IP的套接字的Windows实现.

虽然不会向您展示如何编程套接字接口,但道格拉斯·科默(Douglas Comer)撰写的使用TCP/IP进行互联网络:原理,协议和体系结构" 会告诉您所有您想要了解的有关基础TCP的信息/IP协议.

不幸的是,我还没有找到一本关于Windows套接字编程的好书
The first thing you have to know is the protocol the server uses. If it''s a common one like HTTP you can use an off the shelf library e.g. wininet[^] or libcurl[^] to do the business for you.

If it''s a proprietary protocol or one you specify then you''re going to have to get a bit further down. There is a general API for networking: sockets and the windows implementation of sockets over TCP/IP is in WINSOCK.DLL.

While it won''t show you how to program the sockets interface "Internetworking with TCP/IP: Principles, protocols, and architecture" by Douglas Comer will tell you all you want to know about the underlying TCP/IP protocols.

Unfortunately I''ve yet to find a really good book on sockets programming for windows . This[^] is an okay reference to the API itself. Hopefully someone else can give you a decent reference to a resource they''ve used. I haven''t seen any I''d regard as more than mediocre so it''d be better if you did your own research here. If no-one else can give you a reference I''d search for "Windows sockets programming" and take it from there.


您可以通过网络将数据发送到服务器.为此,您需要创建套接字,为此,您需要知道IP,端口等,然后您必须知道服务器在其中使用数据的协议.然后您发送它. Windows提供套接字API函数.阅读套接字编程将帮助您做到这一点.
you can send data to server via network. For this you need to create socket , for this you need to know the IP,port etc, then you must know the protocol in which your server is expecting the data. then you send it. Windows provides socket API functions. Reading socket programming will help you to do that.


这篇关于如何将一个应用程序生成的数据发送到另一台服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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