p2p

P2P文件分发

时光毁灭记忆、已成空白 提交于 2019-12-13 15:29:16
学习原则: 无实践不学习理论。 P2P文件分发根本没见过,就先不学。 概念介绍 对等方:成对间歇连接的主机 洪流(torrent):参与一个特定文件分发的所有对等方的集合 追踪器(tracker):每个洪流具有一个基础设施结点 邻近对等方:成功创建一个TCP连接的对等方 P2P体系结构的拓展性 客户端-服务器体系结构与P2P体系结构比较,得出如下结论: 客户端-服务器体系下,分发时间随着对等方数量线性增加 P2P体系下,分发时间呈线性增长而趋向一个常数,若F表示分发的文件比特数量,u表示所有对等方具有的相同上传速率,则这个常数为F/u。 最为流行的P2P协议是BitTorrent,迅雷的种子下载就属此列。 BitTorrent 当一个对等方加入某洪流时,它向追踪器注册自己,并周期性地通知追踪器它仍在该洪流中。 工作过程 假设有一个新的对等方Alice加入一个洪流 追踪器随机地从参与对等方的集合中选择对等方的一个子集(比如50个)并将这50个对等方的IP地址发送给Alice,Alice拥有了一个IP地址的列表 Alice与列表上的所有对等方创建TCP连接,成为邻近对等方 Alice周期性的询问每个邻近对等方他们所具有的块列表。 对当前自身没有的块信息,Alice发送请求获取(最稀缺的块,优先级最高请求) 向哪些向她请求的块的邻居发送邻居没有的而自己有的块信息

Unable to implement p2p chat using SignalR in Android

时光怂恿深爱的人放手 提交于 2019-12-13 14:17:53
问题 I have sucessfully implemented SignalR in my android application. and message broadcasting is also working fine. i want to implement p2p chat in my application using SignalR. i checked clients library in Asp.Net, i also tried Google but not getting required output. i checked SignalR, SignalA and SignalJ. i think SignalJ is useful but unable to resolve some library issue like scala and akka can anyone please help me. how can i implement p2p chat using SignalR in my android application? Thank

UDP Hole Punching (c++/winsock)

天大地大妈咪最大 提交于 2019-12-13 01:26:57
问题 stackoverflow users! I have an app that has to deal with p2p, and that's how I get to UDP Hole punching. But I ran into troubles with implementation. Hope, you can give me some tips. I've got server, which works perfect and introduces clients to eachother, but clients can't connect probably because of my small exp working with sockets. So, client algo is: Create udp socket ( socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); ) Send message to server via sendto function Use recvfrom locker function to

Socket.accept() throws null pointer exception

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 01:25:55
问题 I am writing a single p2p file sharing program that will accept connections and also serve as server itself. Its in process but Line: 60 Socket sock1= tcpSocket.accept(); throws a Null pointer Exception and i don't know whats wrong. Tried everything. import java.net.*; import java.io.*; public class echoer implements Runnable { int i,backlog; public Socket tcpClient= null; public ServerSocket tcpSocket= null; public echoer(int tcpPort, int udpPort, int backlog) { try { this.tcpSocket = new

Application - Direct file sharing over Wifi in android

冷暖自知 提交于 2019-12-12 17:27:14
问题 I want to make an application that, when running on 2 different android phones over the same Wifi network, allows them to share files directly (not via internet). But i am stuck where to start from. Keywords of techniques and why they could be required would be much appreciated. Thanks in advance 回答1: Here you can find the example of android direct file sharing over wifi network Click here 回答2: you can start with multicast socket with TCP or UDP protocol. try this link MulticastSocket 来源:

NAT traversal using free STUN and TURN servers in C#

馋奶兔 提交于 2019-12-12 09:16:48
问题 This is my previous post: NAT Traversal using only free STUN and TURN servers in C# I am making an online application that communicates with each other peer-to-peer. Most users are expected to be in their private network behind a NAT, and I need to traverse it. I can't afford an external server, so the only things that I can depend on is free servers like Numb (which means I cannot provide my own implementation or extension of it.) However, after some research, I couldn't figure out how to

Synchronizing time between two Windows 7 machines connected with a LAN cable

半腔热情 提交于 2019-12-12 07:38:20
问题 I have a number laptops that run our application while connected to each other in pairs with an ethernet cable, but not connected to any external network or the internet. T I need the connected pair to synchronize their system times, but since every computer needs to be able to synch with any other computer, I can't define one computer to be a time-server and the other to be a client. Is there a way to do this with NTP? Or some other way? 回答1: NET TIME is the way to go. If you do NET TIME

Getting exception in simple JXTA 2.7 Application

和自甴很熟 提交于 2019-12-12 04:57:34
问题 I am developing a simple program in JXTA 2.7 and it is showing me the following error. public static void main(String[] args) throws IOException, PeerGroupException { System.setProperty(Logging.JXTA_LOGGING_PROPERTY, Level.OFF.toString()); NetworkManager manager = new NetworkManager(NetworkManager.ConfigMode.EDGE, "Test"); System.out.println(" S t a r t ing JXTA"); manager.startNetwork(); System.out.println(" JXTA St a r t ed "); } Error: Exception in thread "main" java.lang

第二章 分布式计算泛型

房东的猫 提交于 2019-12-12 03:56:58
第二章 分布式计算泛型 分布式计算泛型也就是 分布式计算模式例子或模型 。 分布式计算泛型包括消息传递、客户/服务器、p2p、消息系统、远程过程调用、分布式对象、网络服务、移动代理和云服务九种常见泛型。 2.1 消息传递泛型 消息传递是进程之间互相通信的基本途径。 工作原理:两个进程间传递消息,一个为发送者,一个为接收者。发送者发送一条请求消息,该消息被传送到接收者,由接收者处理并发送一条应答消息。 消息传递模式是最基本的传递消息的泛型,很多即时通信工具都是基于该泛型的具体应用。 2.2 客户/服务器泛型 工作原理:客户/服务器泛型由客户端和服务器组成,为两个协作进程分配非对称角色,客户进程向服务器发起请求并等待响应,服务器进程等待来自客户的请求给出回应。 客户/服务器泛型是网络应用中使用最多的一种分布式计算泛型。 2.3 p2p泛型 P2P泛型源于P2P网络(又称为对等计算机网络)。p2p网络是一种无中心服务器,依赖用户群交换的互联网体系,每个用户端既是一个节点,又有服务器的功能。可以说是没有服务器,也可以说每个用户端都是一台服务器。 工作原理:服务器进程提供服务,客户进程通过服务器访问服务。 2.4 消息系统泛型 消息系统泛型或面向对象的中间件是在基本的消息传递泛型的基础上扩展而来的。 工作原理:消息系统充当独立的进程之间的中介,不同的进程以非耦合方式通过消息系统异步地交换消息

best peer to peer technique for mobile network

旧街凉风 提交于 2019-12-12 03:44:51
问题 I deal with design of peer to peer communication between mobile unit and user phone. Mobile unit is targeted into cars, so it is possible that it could be connected to many various ISPs. It can be also expected that the clients will be often disconnects. I need to find best solution in NAT traversal techniques, which is applicable in conditions of mobile network, which are little different than the usual networks as WiFi. I search for often used techniques and found a many different practices