• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * os_trans.h
3  *
4  * Copyright 2001-2009 Texas Instruments, Inc. - http://www.ti.com/
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #ifndef _OS_TRANS_H
19 #define _OS_TRANS_H
20 
21 #include "cu_osapi.h"
22 #include "tidef.h"
23 
24 #ifndef SOCKET_ERROR
25 #define SOCKET_ERROR -1
26 #endif
27 
28 #define MAX_QUEUE_LENGTH	5//maximum length the queue of pending connections
29 
30 typedef  int		SOCKET;
31 
32 TI_BOOL os_trans_create(VOID);
33 TI_BOOL os_socket (THandle* pSock);
34 TI_BOOL os_bind (THandle sock, U16 port);
35 TI_BOOL os_sockWaitForConnection (THandle socket_id, THandle* pConnSock);
36 TI_BOOL os_sockSend (THandle socket_id, PS8 buffer, U32 bufferSize);
37 VOID	os_trans_destroy(VOID);
38 S32		os_sockRecv (THandle socket_id, PU8 pBuffer, U32 bufferSize, TI_SIZE_T flags);
39 
40 #endif
41