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

DHCP Client Functions

4.1.5dhc_second()

This function must be called by the application exactly once every second. It is used to handle retry timeouts and lease expiry.

Syntax

void dhc_second(void)

Return value

None.

4-6

Copyright © 1998-2001 ARM Limited. All rights reserved.

ARM DUI 0144B

Chapter 5

Sockets

This chapter documents the sockets layer. Sockets are an API, primarily used for TCP programming. It 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 5-2

Socket API reference on page 5-3.

ARM DUI 0144B

Copyright © 1998-2001 ARM Limited. All rights reserved.

5-1

Sockets

5.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 do 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(socket) to find out what went wrong. Possible values for sockets errors are listed in tcp\nptcp.h. These errors are a subset of the standard Berkeley sockets errors and are documented in Socket error codes on page A-4.

5-2

Copyright © 1998-2001 ARM Limited. All rights reserved.

ARM DUI 0144B