-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
979e856
commit 708eacd
Showing
5 changed files
with
153 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,6 @@ logs/ | |
server/docker/containers/ | ||
*.h | ||
*.so | ||
|
||
# generic folder to ignore | ||
export/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import ctypes | ||
|
||
p2prc = ctypes.CDLL("SharedOBjects/p2prc.so") | ||
|
||
p2prc.Init("") | ||
|
||
def StartServer(): | ||
# Starting P2PRC as a server mode | ||
p2prc.Server() | ||
for _ in iter(int, 1): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,6 @@ run: | |
|
||
sharedObjects: | ||
sh build-bindings.sh | ||
|
||
python: | ||
sh build-python-package.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/bash | ||
|
||
# Create export directory for python | ||
mkdir Bindings/python/export | ||
|
||
# Creating SharedObjects directory for python | ||
mkdir Bindings/python/export/SharedObjects | ||
|
||
sh build-bindings.sh | ||
|
||
cp Bindings/p2prc.h Bindings/python/export/SharedObjects/ | ||
cp Bindings/p2prc.so Bindings/python/export/SharedObjects/ | ||
|
||
cp Bindings/python/p2prc.py Bindings/python/export/ | ||
|
||
echo "Output is in the Directory Bindings/python/export/" | ||
|
||
# Architectures for Linux | ||
#archs=(amd64 arm64) | ||
# | ||
#for arch in ${archs[@]} | ||
#do | ||
# mkdir Bindings/python/export/SharedObjects/linux-${arch} | ||
# cd Bindings/ | ||
# env GOOS=linux GOARCH=${arch} go build -buildmode=c-shared -o python/export/SharedObjects/linux-${arch}/p2prc.so | ||
# echo "GOOS=linux GOARCH=${arch} go build -buildmode=c-shared -o python/export/SharedObjects/linux-${arch}/p2prc.so" | ||
# cd .. | ||
#done |