CPP=g++ -std=c++14
all:server client
echo "ok"
server: server.cpp config.h socket.o
${CPP} server.cpp socket.o -o server
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
#!/bin/sh | |
# recursively removes all .pyc files and __pycache__ directories in the current | |
# directory | |
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf |
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
// As seen on http://www.di.uniba.it/~reti/LabProRete/Interazione(TCP)Client-Server_Portabile.pdf | |
#if defined WIN32 | |
#include <winsock.h> | |
#else | |
#define closesocket close | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <unistd.h> | |
#endif | |
#include <stdio.h> |
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
CC=gcc | |
INCLUDE=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 | |
LINK=python2.7 | |
FILE=shell | |
$(FILE): $(FILE).c | |
$(CC) $(FILE).c -I$(INCLUDE) -l$(LINK) -o $(FILE) | |
$(FILE).c: | |
cython --embed $(FILE).pyx |