p2p

SCTP 库的简述和代码 (5)

岁酱吖の 提交于 2019-12-05 08:22:25
用户接口设计 设计需求: 接口API, RFC4960有规范, 基本上按照设计就可以了. 需要考虑的地方时, 1. 提供简化的接口,方便懒人. 2. 由于设计此SCTP库的目的是用于p2p传输, 所以,要考虑方便服务于p2p的库. 定义了一个如下回调函数表, 当有连接请求或数据到达时, 回调. typedef struct sctp_call_back_ { sctp_pkg_snd_fn sctp_pkg_snd; data_received_fn data_received_cb; sctp_assoc_up_fn assoc_up_cb; sctp_assoc_down_fn assoc_down_cb; sctp_retrieve_fn retrieve_cb; sctp_debug_fn debug_cb; }sctp_call_back; sctp_pkg_snd 是可选的参数, 如果你想对数据的发送方法做特殊处理, 可以覆盖库的缺省动作. 如果不设置此函数,那么, 将直接发送到对方IP地址:接收SCTP包的UDP端口. data_received_cb, 有SCTP包到达时被触发. retrieve_cb, sctp一个流断掉后, 没有确认的数据包可以用此函数提取, 保证高可靠性. 接口API: 入参, udp_port, 用于sctp流的udp端口. ctx, 可选

区块链在金融领域的应用案例

谁说胖子不能爱 提交于 2019-12-05 03:00:39
区块链这一颠覆性的技术作为当下多种热门概念的交集,将在可预见的未来深刻地影响包括金融业在内的多个行业,制造跨领 域合作的机会,提高资源配置效率,助力产业转型升级。对区块链技术的积极应对或是被动接受,也将导致各行业内部的重新洗牌。在金融领域,区块链提供了一个 全新的视野来俯瞰各类传统金融业务,区块链将成为金融领域的技术重构者、业务重构者以及金融生态重构者。 案例一:布比等公司尝试区块链进行股权登记转让与清算结算 目前,证券的登记、清算和结算涉及多个主体,如图4-7所示的传统股权交易过程涉及中介机构、托管机构、第三方支 付平台、公证人、银行等,交易过程需要经过层层中介传递信息,再经权威机构公证方可完成。中间需要大量人工处理纸质材料信息,这样容易出错,交易效率低下 且交易成本较高。因为一方面,各个机构依赖于本身的IT系统和工作流程,往往需要多方进行数据的反复沟通、核对和发送等,效率较低;另一方面,中心化的系 统容易遭受攻击,对安全性投入要求非常高。 图4-7 证券交易结算流程 区块链的共享、可信、可追溯的特点在清算结算等领域具备显著的优势: (1)区块链是一个共享式的公共账本,可打通不同的系统,从而提升沟通效率,降低成本。 (2)区块链实现交易的时候,基于区块链网络的共识机制实际上可以同时实现清算和结算,这显然比许多交易所的T+1,甚至T+N效率更高。 (3

Creating Peer to Peer connections using intermediate server

这一生的挚爱 提交于 2019-12-05 02:20:37
问题 I want to connect two clients (via TCP/IP sockets). The clients can discover each other using an intermediate server. Once the clients discover each other, there should not be any involvement of the server. I made some study about this and found many people suggesting JXTA . But I'd like to create the protocol myself from scratch (because in future I might have to implement the same using WebSockets as well (when my client is a Browser)). Currently, my clients can be Desktop applications or

Does HTML5 Support Peer-to-Peer (and not just WebSockets)

独自空忆成欢 提交于 2019-12-05 01:52:18
The language I am working in is Javascript on HTML5-compatible browsers. My understanding is that WebSockets require a socket server to transport push notifications and messages back and forth between clients. Is there an actual peer-to-peer capability with HTML5 that does not require a socket server? Has anyone seen example client-side code in Javascript that exemplifies this capability? Chris Morgan See the answers for Will HTML5 allow web apps to make peer-to-peer HTTP connections? However, the content in the WebSockets specification seems to have gone, so I suspect the answer now is "no".

How do I discover peers and send messages in JXTA-JXSE 2.6?

余生长醉 提交于 2019-12-05 01:50:38
问题 Using JXTA 2.6 from http://jxse.kenai.com/ I want to create application that can run multiple peers on one or more hosts. The peers should be able to find each other in a group and send direct messages as well as propagate messages. What would a simple hello world type of application look like that meet these requirements? I created this question with the intention of supplying a tutorial like answer, an answer I tried very hard to find two months ago when starting to look at JXTA for a uni

iPhone P2P - is GKSession unreliable beyond 4 peers?

旧街凉风 提交于 2019-12-04 22:02:08
Original question: The iOS Developer Library mentions in the Game Kit Programming Guide that The maximum size of a client-server game is 16 players. Does this limitation also apply to P2P GKsessions? This was already kind-of asked here (but from a different angle). Updated question: Is GKSession reliable when more than 4 peers are connected? note: The question was updated based on the response by saulobrito below. Reference: One example of an app that uses a large group of peers connected is Seedio . You will notie that they are not using GKSession as bluetooth is not an option for

JXTA P2P application over internet

不想你离开。 提交于 2019-12-04 21:31:34
I am learning JXTA and want to master it. I downloaded the tutorial programs from jxta website I have run all those programs from only one PC and worked perfectly fine. But I want it to work over internet. My friend also has an internet connection. We tried to run socket client on his machine while socket server program was running on my machine. I also tried to make myjxta (a jxta p2p application) to work over internet but had no success. We both have ADSL connection and has D-Link ADSL router GLB-802C. While setting up the router I did entered username and password. There not any proxy

udp packet loss and recovery

对着背影说爱祢 提交于 2019-12-04 20:52:50
I am working on both udp/tcp based P2P for file and real time video streaming application.the application will be developed for both Linux and windows platform using c++. We are using ICE(TCP/UDP hole punching) to implement the P2P. while TCP ensure the packet loss but for UDP I need a decent approach to make sure packet must be delivered to the other peer. I wanted to know the algorithm or technique to do this. Is there any free thord party tool/libraries to do. Any link and suggestion will be appreciated? Len Holgate You might find the answers to this question helpful: What do you use when

Flash Sockets, Peer-to-Peer Capabilities

别说谁变了你拦得住时间么 提交于 2019-12-04 20:52:18
Quick Intro: We have a flash tetris game finished and we are looking to add multiplayer functionality to the game. After a few days of research on the capabilities of flash and sockets, I've gotten even more confused. A quick disclaimer, I am new to sockets/networking in general. From what I gathered online, general flash tcp sockets cannot handle peer to peer connections due to the policy system in place. In order for flash to do p2p, one must use a RTMFP-capable server (such as flash media server, etc) to deal with the initial handshakes and from there, flash is able to pass data in a p2p

OpenSSL: RSA Encryption/Decryption, key generation & key persistance

走远了吗. 提交于 2019-12-04 20:31:46
问题 I am trying to build a p2p application that requires the following, using RSA in OpenSSL: -Encryption -Decryption -Generating Keys (done) -Saving and loading keys (done) -Saving the PUBLIC key as bytes so it can be sent over the sockets -Loading keys from the above format I have chosen to use the EVP functions, whatever that means. However I am having supreme difficulty finding which functions I need to use to do these things, and in what order. Official documentation of OpenSSL seems to be