Rename a project
parent
09a9e7ecc1
commit
1298a1140c
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 ThroughNet
|
||||
Copyright (c) 2016 PeerConnect
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
22
README.md
22
README.md
|
@ -1,6 +1,6 @@
|
|||
# ThroughNet
|
||||
# PeerConnect
|
||||
|
||||
A Throughnet is a P2P network socket library.
|
||||
A PeerConnect is a peer to peer socket library.
|
||||
|
||||
- Network connection by random id or email address
|
||||
- No ip address and port number
|
||||
|
@ -10,23 +10,23 @@ A Throughnet is a P2P network socket library.
|
|||
### How to use
|
||||
Peer A (listen)
|
||||
```
|
||||
Throughnet tn;
|
||||
tn.OnMessage(function_tn(Throughnet* tn, string id, Throughnet::Buffer& data) {
|
||||
PeerConnect pc;
|
||||
pc.OnMessage(function_pc(PeerConnect* pc, string id, PeerConnect::Buffer& data) {
|
||||
std::cout << "A message has been received." << std::endl;
|
||||
});
|
||||
tn.SignIn("PEER_A");
|
||||
pc.SignIn("PEER_A");
|
||||
```
|
||||
|
||||
Peer B (connect)
|
||||
```
|
||||
Throughnet tn;
|
||||
tn.On("signin", function_tn(Throughnet* tn, string id) {
|
||||
tn->Connect("PEER_A");
|
||||
PeerConnect pc;
|
||||
pc.On("signin", function_pc(PeerConnect* pc, string id) {
|
||||
pc->Connect("PEER_A");
|
||||
});
|
||||
tn.On("connect", function_tn(Throughnet* tn, string id) {
|
||||
tn->Send("PEER_A", "Hello");
|
||||
pc.On("connect", function_pc(PeerConnect* pc, string id) {
|
||||
pc->Send("PEER_A", "Hello");
|
||||
});
|
||||
tn.SignIn("PEER_B");
|
||||
pc.SignIn("PEER_B");
|
||||
```
|
||||
|
||||
### How it works
|
||||
|
|
|
@ -80,13 +80,13 @@ macro (MERGE_STATIC_LIBRARIES TARGET_LIB LIBRARIES LIBRARIES_DEBUG)
|
|||
set(MRI_SCRIPT "${MRI_SCRIPT}save\n")
|
||||
set(MRI_SCRIPT "${MRI_SCRIPT}end\n")
|
||||
|
||||
file(WRITE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/throughnet.mri" "${MRI_SCRIPT}")
|
||||
file(WRITE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/peerconnect.mri" "${MRI_SCRIPT}")
|
||||
|
||||
add_custom_command(TARGET ${TARGET_LIB} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${outfile}"
|
||||
"${target_temp_file}"
|
||||
COMMAND rm "${outfile}"
|
||||
COMMAND ${CMAKE_AR} -M < "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/throughnet.mri"
|
||||
COMMAND ${CMAKE_AR} -M < "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/peerconnect.mri"
|
||||
COMMAND rm "${target_temp_file}"
|
||||
)
|
||||
endif (WIN32)
|
||||
|
|
|
@ -43,7 +43,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
//
|
||||
// End of throughnet patch
|
||||
// End of PeerConnect patch
|
||||
|
||||
#include "asio/detail/config.hpp"
|
||||
#include <openssl/conf.h>
|
||||
|
|
Loading…
Reference in New Issue