Changeset 2099 for Whitix/branches/netchannel/user/sdk/network/socket.c
- Timestamp:
- 06/03/10 22:43:33 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/netchannel/user/sdk/network/socket.c
r2096 r2099 1 1 #include <net/socket.h> 2 #include <net/inet_raw.h> 2 3 3 4 #include <stdio.h> 4 5 5 #include "tcp .h"6 #include "tcp/tcp.h" 6 7 #include "udp.h" 7 8 … … 12 13 return -1; 13 14 14 if (type == NET_TYPE_STREAM) 15 memset(socket, 0, sizeof(Socket)); 16 17 switch (type) 15 18 { 16 return _TcpSocketCreate(socket); 17 }else{ 18 return _UdpSocketCreate(socket); 19 case NET_TYPE_STREAM: 20 return _TcpSocketCreate(socket); 21 22 case NET_TYPE_DGRAM: 23 return _UdpSocketCreate(socket); 24 25 case NET_TYPE_DIAG: 26 return _IcmpSocketCreate(socket); 19 27 } 20 28 … … 40 48 int SocketAccept(Socket* socket, Socket* child, struct SockAddr* addr, int* addrLen) 41 49 { 42 printf("SocketAccept(%#X, %#X, %#X, %#X)\n", socket, child, addr, addrLen);43 44 printf("accept = %#X\n", socket->ops->accept);45 46 50 if (socket && socket->ops && socket->ops->accept) 47 51 return socket->ops->accept(socket, child, addr, addrLen);
