diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-06-04 12:19:23 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-06-04 12:35:56 -0700 |
commit | 020c6b72916ddfc09170ab4de0e8f5d2793edcbe (patch) | |
tree | 481376e8c48cb78de3168c595e6cbb559e8d3d50 /tests/websockets_bi.c | |
parent | 2ebaa5c8e1c3715c37ca72e6b687bd18bce14c10 (diff) | |
parent | 4c41c69f202a1b98e10a2a315c3b97bca7bcea04 (diff) |
Merge branch 'incoming' of github.com:kanaka/emscripten into incoming
Diffstat (limited to 'tests/websockets_bi.c')
-rw-r--r-- | tests/websockets_bi.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/websockets_bi.c b/tests/websockets_bi.c index 18cdd664..fb60177b 100644 --- a/tests/websockets_bi.c +++ b/tests/websockets_bi.c @@ -14,6 +14,10 @@ #define EXPECTED_BYTES 28 +#ifndef SOCKK +#define SOCKK 8992 +#endif + int SocketFD; unsigned int get_all_buf(int sock, char* output, unsigned int maxsize) @@ -25,7 +29,11 @@ unsigned int get_all_buf(int sock, char* output, unsigned int maxsize) char buffer[1024]; int n; unsigned int offset = 0; +#if TEST_FILE_OPS + while((errno = 0, (n = read(sock, buffer, sizeof(buffer)))>0) || +#else while((errno = 0, (n = recv(sock, buffer, sizeof(buffer), 0))>0) || +#endif errno == EINTR) { if(n>0) { @@ -96,13 +104,7 @@ int main(void) memset(&stSockAddr, 0, sizeof(stSockAddr)); stSockAddr.sin_family = AF_INET; - stSockAddr.sin_port = htons( -#if EMSCRIPTEN - 8993 -#else - 8992 -#endif - ); + stSockAddr.sin_port = htons(SOCKK); Res = inet_pton(AF_INET, "127.0.0.1", &stSockAddr.sin_addr); if (0 > Res) { |