Socket Types

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
Socket Types

When creating an initialization list for your sockets, you will have to specify a socket type. This parameter will define which protocol can use the socket. You can create and delete socket types as you require. In the sample version of TCPIPConfig.h, the following types are defined:

#define TCP_SOCKET_TYPES
    #define TCP_PURPOSE_GENERIC_TCP_CLIENT 0
    #define TCP_PURPOSE_GENERIC_TCP_SERVER 1
    #define TCP_PURPOSE_TELNET 2
    #define TCP_PURPOSE_FTP_COMMAND 3
    #define TCP_PURPOSE_FTP_DATA 4
    #define TCP_PURPOSE_TCP_PERFORMANCE_TX 5
    #define TCP_PURPOSE_TCP_PERFORMANCE_RX 6
    #define TCP_PURPOSE_UART_2_TCP_BRIDGE 7
    #define TCP_PURPOSE_HTTP_SERVER 8
    #define TCP_PURPOSE_DEFAULT 9
    #define TCP_PURPOSE_BERKELEY_SERVER 10
    #define TCP_PURPOSE_BERKELEY_CLIENT 11
#define END_OF_TCP_SOCKET_TYPES

The TCP_PURPOSE_GENERIC_TCP_CLIENT and TCP_PURPOSE_GENERIC_TCP_SERVER socket types are used by the generic TCP client and server examples (see GenericTCPClient.c and GenericTCPServer.c). These files are used as an example of how to create a new, custom TCP client or server application. 

If you are trying to open a Telnet connection, the stack will try to use a TCP_PURPOSE_TELNET socket. 

The TCP_PURPOSE_FTP_COMMAND and TCP_PURPOSE_FTP_DATA socket types are used to receive FTP commands and data. 

The two TCP_PERFORMANCE_x socket types are used solely to conduct TCP performance testing. 

The TCP_PURPOSE_UART_2_TCP_BRIDGE socket type is used for the UART-to-TCP bridge example. 

The TCP_PURPOSE_HTTP_SERVER socket type is used for sockets on HTTP servers that listen for web page view requests. 

The TCP_PURPOSE_DEFAULT socket type can be used for miscellaneous applications, or for applications that only need sockets temporairly. Dynamic DNS connections and SMTP connections use default sockets, and the legacy wrapper implementation for the TCPListen and TCPConnect functions try to open them. 

The TCP_PURPOSE_BERKELEY_SERVER and TCP_PURPOSE_BERKELEY_CLIENT socket types indicate that a socket is available for the use of the Berkeley API layer (also see BSD Sockets).

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.