108 |
Socket_T socket_create(void *port) { |
Socket_T socket_create(void *port) { |
109 |
|
|
110 |
int s; |
int s; |
|
Socket_T S; |
|
111 |
Port_T p= port; |
Port_T p= port; |
112 |
|
|
113 |
ASSERT(port); |
ASSERT(port); |
114 |
|
|
115 |
if((s= create_generic_socket(p)) != -1) { |
if((s= create_generic_socket(p)) != -1) { |
116 |
|
|
117 |
|
Socket_T S= NULL; |
118 |
|
|
119 |
NEW(S); |
NEW(S); |
120 |
S->socket= s; |
S->socket= s; |
121 |
S->type= p->type; |
S->type= p->type; |
173 |
int timeout) { |
int timeout) { |
174 |
|
|
175 |
int s; |
int s; |
|
Socket_T S; |
|
176 |
int proto= type==SOCKET_UDP?SOCK_DGRAM:SOCK_STREAM; |
int proto= type==SOCKET_UDP?SOCK_DGRAM:SOCK_STREAM; |
177 |
|
|
178 |
ASSERT(host); |
ASSERT(host); |
184 |
|
|
185 |
if((s= create_socket(host, port, proto, timeout)) != -1) { |
if((s= create_socket(host, port, proto, timeout)) != -1) { |
186 |
|
|
187 |
|
Socket_T S= NULL; |
188 |
|
|
189 |
NEW(S); |
NEW(S); |
190 |
S->socket= s; |
S->socket= s; |
191 |
S->port= port; |
S->port= port; |