2 * Copyright (c) 2006-2007 Apple Inc. All Rights Reserved.
4 * ioSock.h - socket-based I/O routines for SecureTransport tests
10 #include <Security/SecureTransport.h>
11 #include <sys/types.h>
18 * Opaque reference to an Open Transport connection.
23 * info about a peer returned from MakeServerConnection() and
24 * AcceptClientConnection().
39 extern OSStatus
MakeServerConnection(
42 int nonBlocking
, // 0 or 1
43 otSocket
*socketNo
, // RETURNED
44 PeerSpec
*peer
); // RETURNED
47 * Set up an otSocket to listen for client connections. Call once, then
48 * use multiple AcceptClientConnection calls.
50 OSStatus
ListenForClients(
52 int nonBlocking
, // 0 or 1
53 otSocket
*socketNo
); // RETURNED
56 * Accept a client connection. Call endpointShutdown() for each successful;
57 * return from this function.
59 OSStatus
AcceptClientConnection(
60 otSocket listenSock
, // obtained from ListenForClients
61 otSocket
*acceptSock
, // RETURNED
62 PeerSpec
*peer
); // RETURNED
65 * Shut down a connection.
67 void endpointShutdown(
71 * R/W. Called out from SSL.
74 SSLConnectionRef connection
,
75 void *data
, /* owned by
78 size_t *dataLength
); /* IN/OUT */
81 SSLConnectionRef connection
,
83 size_t *dataLength
); /* IN/OUT */
89 #endif /* _IO_SOCK_H_ */