-
Notifications
You must be signed in to change notification settings - Fork 4
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
Your Name
committed
Jul 17, 2015
1 parent
6399348
commit 034a9a2
Showing
9 changed files
with
213 additions
and
29 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
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
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,29 @@ | ||
#include "pgw.h" | ||
|
||
void* multithreading_func(void *arg){ | ||
int type; | ||
ClientDetails *entity = *(ClientDetails*)arg; | ||
Server pgw; | ||
pgw.fill_server_details(g_pgw_port + entity.num, g_pgw_address); | ||
pgw.bind_server(); | ||
pgw.client_sock_addr = entity.client_sock_addr; | ||
pgw.connect_with_client(); | ||
pgw.read_data(); | ||
memcpy(&type, pgw.pkt.data, sizeof(int)); | ||
if(type == 1) | ||
handle_cdata(pgw); | ||
else if(type == 2) | ||
handle_udata(pgw); | ||
} | ||
|
||
void handle_cdata(Server &pgw){ | ||
|
||
} | ||
|
||
int main(){ | ||
Server pgw; | ||
pgw.fill_server_details(g_pgw_port, g_pgw_address); | ||
pgw.bind_server(); | ||
pgw.listen_accept(multithreading_func); | ||
return 0; | ||
} |
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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
#ifndef PGW_H | ||
#define PGW_H | ||
|
||
#include "utils.h" | ||
#include "packet.h" | ||
#include "server.h" | ||
#include "raw_socket.h" | ||
|
||
void* multithreading_func(void*); | ||
void handle_cdata(); | ||
void handle_udata(); | ||
|
||
#endif //PGW_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "sgw.h" | ||
|
||
void* multithreading_func(void *arg){ | ||
int type; | ||
ClientDetails *entity = *(ClientDetails*)arg; | ||
Server sgw; | ||
sgw.fill_server_details(g_sgw1_port + entity.num, g_sgw1_address); | ||
sgw.bind_server(); | ||
sgw.client_sock_addr = entity.client_sock_addr; | ||
sgw.connect_with_client(); | ||
sgw.read_data(); | ||
memcpy(&type, sgw.pkt.data, sizeof(int)); | ||
if(type == 1) | ||
handle_cdata(sgw); | ||
else if(type == 2) | ||
handle_udata(sgw); | ||
} | ||
|
||
void handle_cdata(Server &sgw){ | ||
|
||
} | ||
|
||
int main(){ | ||
Server sgw; | ||
sgw.fill_server_details(g_sgw1_port, g_sgw1_address); | ||
sgw.bind_server(); | ||
sgw.listen_accept(multithreading_func); | ||
return 0; | ||
} |
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
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