/[jscoverage]/trunk/tests/http-server-close-immediately.c
ViewVC logotype

Diff of /trunk/tests/http-server-close-immediately.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 609 by siliconforks, Sat Jan 2 04:55:54 2010 UTC revision 610 by siliconforks, Fri Sep 24 20:35:36 2010 UTC
# Line 25  Line 25 
25    
26  #include "http-server.h"  #include "http-server.h"
27    
28  int main(void) {  int main(int argc, const char ** argv) {
29  #ifdef __MINGW32__  #ifdef __MINGW32__
30    WSADATA data;    WSADATA data;
31    if (WSAStartup(MAKEWORD(1, 1), &data) != 0) {    if (WSAStartup(MAKEWORD(1, 1), &data) != 0) {
# Line 33  Line 33 
33    }    }
34  #endif  #endif
35    
36      assert(argc == 2);
37      uint16_t port = (uint16_t) atoi(argv[1]);
38    
39    SOCKET s = socket(PF_INET, SOCK_STREAM, 0);    SOCKET s = socket(PF_INET, SOCK_STREAM, 0);
40    assert(s != INVALID_SOCKET);    assert(s != INVALID_SOCKET);
41    
# Line 41  Line 44 
44    
45    struct sockaddr_in a;    struct sockaddr_in a;
46    a.sin_family = AF_INET;    a.sin_family = AF_INET;
47    a.sin_port = htons(8000);    a.sin_port = htons(port);
48    a.sin_addr.s_addr = htonl(INADDR_LOOPBACK);    a.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
49    int result = bind(s, (struct sockaddr *) &a, sizeof(a));    int result = bind(s, (struct sockaddr *) &a, sizeof(a));
50    assert(result == 0);    assert(result == 0);

Legend:
Removed from v.609  
changed lines
  Added in v.610

  ViewVC Help
Powered by ViewVC 1.1.24