Interface of APP and TCP/IP
Version: 1.3.0 SW-BASE-AN-0001 2006-6-16
www.spreadtrum
Spreadtrum Confidential and Proprietary
Interface of APP and TCP/IP
Revision History
VERSION
0.0.2 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0
DATE
2003-4-8 2003-8-15 2004-5-31 2004-6-09 2006-6-16 2006-3-29
PREPARED BY
APPROVED BY
NOTE
Draft Modified Modified Updated upon the Review problems. Add sci_sock_getsockstate api function Special API functions added
Hyman wu Hyman wu Hyman wu Hyman wu Jason cui Hyman wu
Hellena.Zhu Hyman wu Feng.shi
V.1.3.0
Spreadtrum Confidential and Proprietary
This document contains information on a product under development Spreadtrum reserves the right to change or discontinue this product without notice.
2 of 38
Interface of APP and TCP/IP
IMPORTANT NOTICE
COPYRIGHT NOTICE Copyright © 2005, Spreadtrum Communications, Inc. All rights reserved. TRADEMARKS Spreadtrum Communications, Inc. and Spreadtrum Communications, Inc.’s products are exclusively owned by Spreadtrum Communications, Inc.. References to other companies and their products use trademarks owned by the respective companies and are for reference purpose only. WARRANTY DISCLAIMER Spreadtrum Communications, Inc. makes no representations or warranties, either express or implied, by or with respect to anything in this document, and shall not be liable for any implied warranties of merchantability or fitness for a particular purpose or for any indirect, special or consequential damages.
CONFIDENTIALITY The information contained herein (including any attachments) is confidential. The recipient hereby acknowledges the confidentiality of this document, and except for the specific purpose, this document shall not be disclosed to any third party.
V.1.3.0
Spreadtrum Confidential and Proprietary
This document contains information on a product under development Spreadtrum reserves the right to change or discontinue this product without notice.
3 of 38
Interface of APP and TCP/IP
Table of Contents
Table of Contents ..................................................................................................................... 4 1 Introduction ....................................................................................................................... 6 1.1 1.2 1.3 6 Acronyms ..................................................................................................................... 6
< 7 2.1 Sockets API 7 2.1.1 Sockets API function list ........................................................................................ 7 2.1.1.1 sci_sock_socket() ..............................................................................................................7 2.1.1.2 sci_sock_getsockstat
e() .....................................................................................................8 2.1.1.3 sci_sock_listen()................................................................................................................9 2.1.1.4 sci_sock_connect() ..........................................................................................................10 2.1.1.5 sci_sock_socketclose() ....................................................................................................10 2.1.1.6 sci_sock_select() .............................................................................................................11 2.1.1.7 sci_sock_recv(), sci_sock_recvfrom().............................................................................12 2.1.1.8 sci_sock_send(), sci_sock_sendto() ................................................................................13 2.1.1.9 sci_sock_accept() ............................................................................................................14 2.1.1.10 sci_sock_bind() ...........................................................................................................15 2.1.1.11 sci_sock_shutdown() ...................................................................................................15 2.1.1.12 sci_sock_getpeername() ..............................................................................................16 2.1.1.13 sci_sock_getsockname()..............................................................................................16 2.1.1.14 sci_sock_getsockopt(), sci_sock_setsockopt() ............................................................16 2.1.1.15 sci_sock_errno() ..........................................................................................................18 2.1.2 Demo program codes 20 2.1.2.1 Demo codes of tcp client .................................................................................................20 2.1.2.2 Demo codes of tcp 22 2.1.3 Demo program codes of
UDP ............................................................................. 24 2.2 Lightweight UDP API . 28 2.2.1 UDP API function list ........................................................................................... 28 2.2.1.1 sci_udp_send().................................................................................................................28 2.2.1.2 sci_udp_open() ................................................................................................................28 2.2.1.3 sci_udp_close()................................................................................................................29 2.2.2 Demo 30 2.3 DNS API Calls Reference:.......................................................................................... 32 2.3.1 DNS API 32 2.3.1.1 sci_gethostbyname()........................................................................................................32 2.3.1.2 sci_parse_host()...............................................................................................................32 2.3.1.3 sci_gethostname()............................................................................................................32 2.3.2 Demo codes of DNS API ..................................................................................... 33 2.4 Special socket API 33 2.4.1 inet_aton () .......................................................................................................... 33 2.4.2 inet_ntoa () .......................................................................................................... 34 2.4.3 sci_getsockthroughput () ..................................................................................... 34 2.5 Socket Data 35 V.1.3.0
Spreadtrum Confidential and Proprietary
This document contains information on a product under development Spreadtrum reserves the right to change or discontinue this product without notice.
4 of 38
Interface of APP and TCP/IP
3
Annex ............................................................................................................................... 37 3.1 3.2 3.3 Socket API calls in TCP program ............................................................................... 37 Socket API calls in UDP program ............................................................................... 38
V.1.3.0tcpip协议pdf
Spreadtrum Confidential and Proprietary
This document contains information on a product under development Spreadtrum reserves the right to change or discontinue this product without notice.
5 of 38

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。