| #ifdef _MSC_VER |
| #include <windows.h> |
| #else |
| #include <unistd.h> |
| #include <sys/wait.h> |
| #include <sys/stat.h> |
| #include <stdlib.h> |
| #include <signal.h> |
| #include <dirent.h> |
| #include <cstdio> |
| #include <fcntl.h> |
| #endif |
| #include <cstring> |
| #include <string> |
| #include <sstream> |
| #include <iostream> |
| |
| using namespace std; |
| |
| #define BUF_SIZE 512 |
| |
| char buffer[BUF_SIZE]; |
| char readbuffer[BUF_SIZE]; |
| string buf; |
| void Send_message(); |
| |
| #ifdef _MSC_VER |
| #define SYNC_EVENT LPCWSTR("sync") |
| HANDLE hEvent; |
| HANDLE hNamedPipe; |
| LPSTR szPipeName = "\\\\.\\pipe\\$mypipe$"; |
| DWORD cbWritten; |
| DWORD cbRead; |
| #else |
| #define NAMEDPIPE_NAME "/tmp/serverok" |
| int fd, len, pnum; |
| #endif |