sm.sw.DialSeeds(sm.addrBook, seeds)}
In fact, it is called sm.sw.DialSeeds , and sm.sw it refers to Switch . At this point, we can see that there is a thing called to addrBook participate in, it saved the node before the link successfully connected to the address, we do not have much discussion here.
Switch.DialSeedsCorresponds to:
p2p/switch.go#l311
func (sw *Switch) DialSeeds(addrBook *AddrBook, seeds []string) error { // ... perm := rand.Perm(len(netAddrs)) for i := 0; i
The random
The latest and most comprehensive ASP. NET Learning ResourcesHttp://hi.baidu.com/rtqqrtqq/blog/item/e6f15437e021abd4a2cc2bf5.html
This article is original to ASP. NET development network in ChinaArticle, The source must be specified for reprinting. Name: ASP. NETAddress: http://www.asp.net/Introduction: laichao, materials, and instances of Microsoft. NET webformCodeAre very rare.
Name: csdn Documentation CenterAddress: http://dev.csdn.net/Descript
world generate duplicate GUID values.3. When the GUID is required, it can be automatically generated by the algorithm, without the need of an authoritative agency to manage it.The 4.GUID is fixed in length and relatively short, and is ideal for sorting, labeling, and storage.Third, GUID generation function
Copy Code code as follows:
function Create_guid () {
$charid = Strtoupper (MD5 (Uniqid (Mt_rand (), true));
$hyphen = Chr (45);//"-"
$uuid = Chr (123)//"{"
. substr ($c
two computers in the world will generate duplicate GUID values.
3. When a GUID is required, it can be automatically generated by the algorithm and does not require an authoritative authority to manage it.
The 4.GUID is fixed in length and relatively short, and is ideal for sorting, labeling, and storage.
third, GUID generation function
Copy CodeThe code is as follows:
function Create_guid () {
$charid = Strtoupper (MD5 (Uniqid (Mt_rand (), true));
$hyphen = Chr (45);//"-"
$uuid = Chr (123)//"
two computers in the world will generate duplicate GUID values.
3. When a GUID is required, it can be automatically generated by the algorithm and does not require an authoritative authority to manage it.
The 4.GUID is fixed in length and relatively short, and is ideal for sorting, labeling, and storage.
third, GUID generation function
Copy CodeThe code is as follows:
function Create_guid () {
$charid = Strtoupper (MD5 (Uniqid (Mt_rand (), true));
$hyphen = Chr (45);//"-"
$uuid = Chr (123)//"
Recently, I made a low-level error in my project. I used obtaining the Client IP address as the IP address of the local machine. I was very trained. Ah, yes, I am so stupid, deserve it.
Java:
public String getIpAddr(HttpServletRequest request) { String ip = request.getHeader("x-forwarded-for"); if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if(ip == null || ip.length() == 0 || "unknow
To get the IP of other users, you may encounter request.getremoteaddr () to get a value of 0:0:0:0:0:0:0:1, which is why, according to the truth, Should be 127.0.0.1, why the value of this to become a IPv6, and I found that this situation only in the server and the client are on the same computer will appear (for example, when the use of localhost access), and later on the Internet check the reason, the original is/etc/ Hosts this thing mischief (on Windows should be C:\Windows\system32\drivers\
the algorithm without being managed by an authority.4. The GUID has a fixed length and is relatively short and small. It is suitable for sorting, identification, and storage.Iii. GUID generation functionCopy codeThe Code is as follows:Function create_guid (){$ Charid = strtoupper (md5 (uniqid (mt_rand (), true )));$ Hyphen = chr (45 );//"-"$ Uuid = chr (123 )//"{". Substr ($ charid, 0, 8). $ hyphen. Substr ($ charid, 8, 4). $ hyphen. Substr ($ charid, 12, 4). $ hyphen. Substr ($ charid, 16, 4).
Name: Quick StartAddress: http://chs.gotdotnet.com/quickstart/Description: This website is a quick start website for Microsoft. NET technology. You do not have to install the Quick Start sample program in. NET Framework.**************************************** ************Name: ASP. NETAddress: http://www.asp.netDescription: The old nest of Microsoft. NET webform, which has rare materials and instance code.**************************************** ****
.****************************************************Name: dotnet China netAddress: http://www.aspxcn.com/Description: 2002-2003 When this site is very good, but now it seems that the management is not effective, a bit weak, data update also but timely, the Forum people are not enthusiastic, because I hope it better, so listed. The data is old, but some D-editions are OK. Provides a lot of learning code.************************************************
network bandwidth of 128 KB)
Cisco2501 (config) # ip route 0.0.0.0 0.0.0.0 Serial0
(Specify the default route)
Cisco2501 (config) # ip nat pool a 61.138.0.93 61.138.0.93 netmask 255.255.252
(Specify the internal valid address pool, starting address, and ending address as the valid IP address 61.138.0.93)
Cisco2501 (config) # access-list 1 permit 192.168.0.0 0.0.255
(Define a standard access-list rule to allow which internal addresses can be converted)
Cisco2501 (config) # ip nat inside source l
out seeds := strings.Split(sm.config.P2P.Seeds, ",") if err := sm.DialSeeds(seeds); err != nil { return err } } return nil}
In this case sm.config.P2P.Seeds , the seed nodes in the local data directory are the corresponding config.toml p2p.seeds .
Then sm.DialSeeds actively connect each seed by going to:
netsync/handle.go#l229-l231
func (sm *SyncManager) DialSeeds(seeds []string) error { return sm.sw.DialSeeds(sm.addrBook, seeds)}
p2p/switch.go#l311-l340
internal addresses and valid IP addresses)
Cisco2501 (config) # end
Cisco2501 # wr
(Ii) 3COM Router
Taking 3COM OCBN8832 as an example, the software version must be later than 11.0.
Register as root and perform the following configuration
(1) configure the LAN port
[1] EnterpriseOS # setdefault! 1-ip netaddress = 192.168.0.254 255.255.255.0
[2] EnterpriseOS # setdefault !! -Path control = enable: activates the local port PATH of the router)
[3] Enter
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.