projects
/
my-code
/
api.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1634311
)
some changes to network api
author
hackbard
<hackbard>
Thu, 28 Oct 2004 18:53:51 +0000
(18:53 +0000)
committer
hackbard
<hackbard>
Thu, 28 Oct 2004 18:53:51 +0000
(18:53 +0000)
network/network.c
patch
|
blob
|
history
network/network.h
patch
|
blob
|
history
diff --git
a/network/network.c
b/network/network.c
index
1160e7c
..
aefb7c2
100644
(file)
--- a/
network/network.c
+++ b/
network/network.c
@@
-7,17
+7,22
@@
#include "network.h"
int network_init(t_net *net,int outfd) {
#include "network.h"
int network_init(t_net *net,int outfd) {
-
- struct sockaddr_in addr;
- int true;
-
- dprintf(outfd,"[network] initializing network ...\n");
+
+ dprintf(net->outfd,"[network] initializing network api ...\n");
memset(net->connection,0,MAX_CONNECTIONS*sizeof(t_connection));
net->c_count=0;
net->sendmask=0;
net->outfd=outfd;
memset(net->connection,0,MAX_CONNECTIONS*sizeof(t_connection));
net->c_count=0;
net->sendmask=0;
net->outfd=outfd;
+ return N_SUCCESS;
+}
+
+int network_listen(t_net *net) {
+
+ struct sockaddr_in addr;
+ int true;
+
if((net->l_fd=socket(AF_INET,SOCK_STREAM,0))==-1) {
perror("[network] socket call");
return N_ERROR;
if((net->l_fd=socket(AF_INET,SOCK_STREAM,0))==-1) {
perror("[network] socket call");
return N_ERROR;
diff --git
a/network/network.h
b/network/network.h
index
d234d9c
..
281a43f
100644
(file)
--- a/
network/network.h
+++ b/
network/network.h
@@
-68,6
+68,7
@@
typedef struct s_net {
/* function prototypes */
int network_init(t_net *net,int outfd);
/* function prototypes */
int network_init(t_net *net,int outfd);
+int network_listen(t_net *net);
int network_shutdown(t_net *net);
int network_set_listen_port(t_net *net,in_port_t port);
int network_manage_connection(t_net *net);
int network_shutdown(t_net *net);
int network_set_listen_port(t_net *net,in_port_t port);
int network_manage_connection(t_net *net);