I have a problem getting this to work. Server only recieves half of the data being sent. Whats wrong

Dependencies:   mbed

Committer:
tax
Date:
Tue Mar 29 13:20:15 2011 +0000
Revision:
0:66300c77c6e9

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tax 0:66300c77c6e9 1 /*
tax 0:66300c77c6e9 2 * Redistribution and use in source and binary forms, with or without modification,
tax 0:66300c77c6e9 3 * are permitted provided that the following conditions are met:
tax 0:66300c77c6e9 4 *
tax 0:66300c77c6e9 5 * 1. Redistributions of source code must retain the above copyright notice,
tax 0:66300c77c6e9 6 * this list of conditions and the following disclaimer.
tax 0:66300c77c6e9 7 * 2. Redistributions in binary form must reproduce the above copyright notice,
tax 0:66300c77c6e9 8 * this list of conditions and the following disclaimer in the documentation
tax 0:66300c77c6e9 9 * and/or other materials provided with the distribution.
tax 0:66300c77c6e9 10 * 3. The name of the author may not be used to endorse or promote products
tax 0:66300c77c6e9 11 * derived from this software without specific prior written permission.
tax 0:66300c77c6e9 12 *
tax 0:66300c77c6e9 13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
tax 0:66300c77c6e9 14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
tax 0:66300c77c6e9 15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
tax 0:66300c77c6e9 16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
tax 0:66300c77c6e9 17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
tax 0:66300c77c6e9 18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
tax 0:66300c77c6e9 19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
tax 0:66300c77c6e9 20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
tax 0:66300c77c6e9 21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
tax 0:66300c77c6e9 22 * OF SUCH DAMAGE.
tax 0:66300c77c6e9 23 *
tax 0:66300c77c6e9 24 * This file is part of the lwIP TCP/IP stack.
tax 0:66300c77c6e9 25 *
tax 0:66300c77c6e9 26 * Author: Simon Goldschmidt
tax 0:66300c77c6e9 27 *
tax 0:66300c77c6e9 28 */
tax 0:66300c77c6e9 29 #ifndef __LWIP_NETDB_H__
tax 0:66300c77c6e9 30 #define __LWIP_NETDB_H__
tax 0:66300c77c6e9 31
tax 0:66300c77c6e9 32 #include "lwip/opt.h"
tax 0:66300c77c6e9 33
tax 0:66300c77c6e9 34 #if LWIP_DNS && LWIP_SOCKET
tax 0:66300c77c6e9 35
tax 0:66300c77c6e9 36 #include <stddef.h> /* for size_t */
tax 0:66300c77c6e9 37
tax 0:66300c77c6e9 38 #include "lwip/inet.h"
tax 0:66300c77c6e9 39 #include "lwip/sockets.h"
tax 0:66300c77c6e9 40
tax 0:66300c77c6e9 41 /* some rarely used options */
tax 0:66300c77c6e9 42 #ifndef LWIP_DNS_API_DECLARE_H_ERRNO
tax 0:66300c77c6e9 43 #define LWIP_DNS_API_DECLARE_H_ERRNO 1
tax 0:66300c77c6e9 44 #endif
tax 0:66300c77c6e9 45
tax 0:66300c77c6e9 46 #ifndef LWIP_DNS_API_DEFINE_ERRORS
tax 0:66300c77c6e9 47 #define LWIP_DNS_API_DEFINE_ERRORS 1
tax 0:66300c77c6e9 48 #endif
tax 0:66300c77c6e9 49
tax 0:66300c77c6e9 50 #ifndef LWIP_DNS_API_DECLARE_STRUCTS
tax 0:66300c77c6e9 51 #define LWIP_DNS_API_DECLARE_STRUCTS 1
tax 0:66300c77c6e9 52 #endif
tax 0:66300c77c6e9 53
tax 0:66300c77c6e9 54 #if LWIP_DNS_API_DEFINE_ERRORS
tax 0:66300c77c6e9 55 /** Errors used by the DNS API functions, h_errno can be one of them */
tax 0:66300c77c6e9 56 #define EAI_NONAME 200
tax 0:66300c77c6e9 57 #define EAI_SERVICE 201
tax 0:66300c77c6e9 58 #define EAI_FAIL 202
tax 0:66300c77c6e9 59 #define EAI_MEMORY 203
tax 0:66300c77c6e9 60
tax 0:66300c77c6e9 61 #define HOST_NOT_FOUND 210
tax 0:66300c77c6e9 62 #define NO_DATA 211
tax 0:66300c77c6e9 63 #define NO_RECOVERY 212
tax 0:66300c77c6e9 64 #define TRY_AGAIN 213
tax 0:66300c77c6e9 65 #endif /* LWIP_DNS_API_DEFINE_ERRORS */
tax 0:66300c77c6e9 66
tax 0:66300c77c6e9 67 #if LWIP_DNS_API_DECLARE_STRUCTS
tax 0:66300c77c6e9 68 struct hostent {
tax 0:66300c77c6e9 69 char *h_name; /* Official name of the host. */
tax 0:66300c77c6e9 70 char **h_aliases; /* A pointer to an array of pointers to alternative host names,
tax 0:66300c77c6e9 71 terminated by a null pointer. */
tax 0:66300c77c6e9 72 int h_addrtype; /* Address type. */
tax 0:66300c77c6e9 73 int h_length; /* The length, in bytes, of the address. */
tax 0:66300c77c6e9 74 char **h_addr_list; /* A pointer to an array of pointers to network addresses (in
tax 0:66300c77c6e9 75 network byte order) for the host, terminated by a null pointer. */
tax 0:66300c77c6e9 76 #define h_addr h_addr_list[0] /* for backward compatibility */
tax 0:66300c77c6e9 77 };
tax 0:66300c77c6e9 78
tax 0:66300c77c6e9 79 struct addrinfo {
tax 0:66300c77c6e9 80 int ai_flags; /* Input flags. */
tax 0:66300c77c6e9 81 int ai_family; /* Address family of socket. */
tax 0:66300c77c6e9 82 int ai_socktype; /* Socket type. */
tax 0:66300c77c6e9 83 int ai_protocol; /* Protocol of socket. */
tax 0:66300c77c6e9 84 socklen_t ai_addrlen; /* Length of socket address. */
tax 0:66300c77c6e9 85 struct sockaddr *ai_addr; /* Socket address of socket. */
tax 0:66300c77c6e9 86 char *ai_canonname; /* Canonical name of service location. */
tax 0:66300c77c6e9 87 struct addrinfo *ai_next; /* Pointer to next in list. */
tax 0:66300c77c6e9 88 };
tax 0:66300c77c6e9 89 #endif /* LWIP_DNS_API_DECLARE_STRUCTS */
tax 0:66300c77c6e9 90
tax 0:66300c77c6e9 91 #if LWIP_DNS_API_DECLARE_H_ERRNO
tax 0:66300c77c6e9 92 /* application accessable error code set by the DNS API functions */
tax 0:66300c77c6e9 93 extern int h_errno;
tax 0:66300c77c6e9 94 #endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/
tax 0:66300c77c6e9 95
tax 0:66300c77c6e9 96 struct hostent *lwip_gethostbyname(const char *name);
tax 0:66300c77c6e9 97 int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
tax 0:66300c77c6e9 98 size_t buflen, struct hostent **result, int *h_errnop);
tax 0:66300c77c6e9 99 void lwip_freeaddrinfo(struct addrinfo *ai);
tax 0:66300c77c6e9 100 int lwip_getaddrinfo(const char *nodename,
tax 0:66300c77c6e9 101 const char *servname,
tax 0:66300c77c6e9 102 const struct addrinfo *hints,
tax 0:66300c77c6e9 103 struct addrinfo **res);
tax 0:66300c77c6e9 104
tax 0:66300c77c6e9 105 #if LWIP_COMPAT_SOCKETS
tax 0:66300c77c6e9 106 #define gethostbyname(name) lwip_gethostbyname(name)
tax 0:66300c77c6e9 107 #define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \
tax 0:66300c77c6e9 108 lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop)
tax 0:66300c77c6e9 109 #define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo)
tax 0:66300c77c6e9 110 #define getaddrinfo(nodname, servname, hints, res) \
tax 0:66300c77c6e9 111 lwip_getaddrinfo(nodname, servname, hints, res)
tax 0:66300c77c6e9 112 #endif /* LWIP_COMPAT_SOCKETS */
tax 0:66300c77c6e9 113
tax 0:66300c77c6e9 114 #endif /* LWIP_DNS && LWIP_SOCKET */
tax 0:66300c77c6e9 115
tax 0:66300c77c6e9 116 #endif /* __LWIP_NETDB_H__ */