Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ARM).Porting TCP-IP programmer's guide.Ver 1.4.pdf
Скачиваний:
31
Добавлен:
23.08.2013
Размер:
2.79 Mб
Скачать

Chapter 9

Sockets

This chapter documents the sockets layer. Sockets are an API, primarily used for TCP programming. This chapter provides a functional reference for the socket subset supported by the ARM TCP/IP stack. For more general information on sockets programming, many books and tutorials are available, for example, Internetworking with TCP/IP.

This chapter contains the following sections:

ARM implementation of sockets on page 9-2

Socket API reference on page 9-3.

ARM DUI 0079B

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

9-1

Sockets

9.1ARM implementation of sockets

In the ARM implementation of sockets, function names start with t_, for example, socket() is t_socket(). The names have been changed so that existing embedded systems that use standard socket functions will not have a conflict at link time. By adding the appropriate definitions to your tcpport.h file, you can continue to use the original socket function names in your code.

Also in the ARM implementation, the UNIX errno mechanism has been replaced by an error holder attached to each socket structure. The error holder is assigned a value when an error occurs. When a socket call indicates failure, you can examine this member or call t_errno() to find out what went wrong. Possible values for sockets errors are listed in ipport.h. These errors are a subset of the standard Berkeley sockets errors and are documented in Socket error codes on page A-3.

9-2

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

ARM DUI 0079B