%META:TOPICINFO{author="MarvChiang" date="1109083914" format="1.0" version="1.15"}% %META:TOPICPARENT{name="WebHome"}%
Date | Weight | Project |
2005-1-19 | 4% |
|
2005-1-21 | 1% |
|
2005-2-2 | 5% |
|
2005-2-11 | 7% |
|
2005-2-18 | 6% |
|
2005-3-4 | 7% |
|
2005-3-11 | 3% |
|
2005-3-17 | 7% |
|
13 generated.c 1 url.c 2 typelib.c 3 file.c
- int WSAStartup( WORD wVersionRequested, LPWSADATA lpWSAData ); - SOCKET socket( int af, int type, int protocol ); - int bind( SOCKET s, const struct sockaddr* name, int namelen ); - int listen( SOCKET s, int backlog ); - SOCKET accept( SOCKET s, struct sockaddr* addr, int* addrlen ); - int connect( SOCKET s, const struct sockaddr* name, int namelen ); - int send( SOCKET s, const char* buf, int len, int flags ); - int recv( SOCKET s, char* buf, int len, int flags );
1. Request the following Winsock versions for WORD wVersionRequested: a. 1.0 b. 1.1 c. 2.0 Using the different combinations, generate the error code WSAVERNOTSUPPORTED, and proper version requests. 2. Pass in a bad pointer for lpWSAData, and generate WSAEFAULT error. 3. Remove the Windows Sockets DLL file to attempt to generate the WSASYSNOTREADY error. 4. Instantiate two network operations to generate WSAEINPROGRESS error and possibly the WSAEPROCLIM error. 5. Record multiple successful calls and verify return code 0.
1 Success - return socket descriptor(no way to verify except that it's != INVALID_SOCKET) a. TCP b. UDP 2. Fail - return INVALID_SOCKET a. WAStartup was not called(or failed) b. invalid address c. no more socket descriptors(will try to implement but may not be able to) d. no more buffer(same as above) e. invalid protocol
1. Successful Bind a. TCP b. UDP 2. Error a. return SOCKET_ERROR i. invalud SOCKET descriptor ii. invalid sockaddr struct iii. invalid namelen iv. unsuccessful WAStartup called v. tried to open UDP when SO_BROADCAST is not enabled vi. address is already bound to another process vii. invalud address viii. socket already bound to another address ix. too many connections/not enough buffer -> not sure if this can be done yet
1 success - return 0 a. TCP b. UDP 2. fail - return SOCKET_ERROR a. WAStartup not called successfully b. socket's local address is already in use c. socket not bound with bind() d. socket is already connected e. no more socket descriptors available f. No more buffer space g. invalid descriptor
1. Success - returns a value of type SOCKET (descriptor for new socket) a. TCP b. UDP 2. Failure - returns a value of INVALID_SOCKET a. Call before initialization, generating WSANOTINITIALISED error. b. Use a small addrlen for WSAEFAULT error. c. Call during a blocking sockets call to get WSAEINTR error. d. Simulate network failure to get WSAENETDOWN error. e. Use an invalid socket to generate WSAEOPNOTSUPP error. f. Flood the buffer to generate WSAENOBUFS error.
1. Success - 0 returned a. TCP b. UDP 2. Fail - SOCKET_ERROR returned a. WAStartup not called successfully b. socket's local address already in use c. invalid address d. invalud namelen e. socket parameter is a listening socket f. socket already connected g. no buffer space h. invalid descriptor
1. Success - returns number of bytes received(!= SOCKET_ERROR) a. TCP b. UDP 2. Failure a. Pass invalid socket descriptor to generate WSAENOTSOCK error. b. Call the fucntion before initialization to generate WSANOTINITIALIZED. c. Create an extremely large input buffer to generate WSAEMSGIZE error. d. Simulate network failure for errors WSAENETDOWN, WSAECONNRESET, WSETIMEDOUT e. Call during blocking Windows call in progress to get WSAEINPROGRESS.
1. Success - returns number of bytes received(!= SOCKET_ERROR) a. TCP b. UDP for each try to test cases where you get 0 byte(connection closed) and non-0 bytes received 2. Fail - returns SOCKET_ERROR a. WAStartup was not called successfullly b. socket not connected c. buf not allocated properly d. invalid descriptor e. socket was marked 'non-blocking' even though recv() will block f. message was too large(truncated) g. bind was not successfully called earlier
1. Success - returns 0 2. Fail - returns SOCKET_ERROR a. WAStartup was not called successfullly b. invalid socket c. invalud handler