ObjFW  Diff

Differences From Artifact [dc54bd8b6a]:

  • File src/OFTCPSocket.h — part of check-in [c83137e7cd] at 2008-12-11 13:43:35 on branch trunk — Remove - close from OFStream protocol.
    The reason is that closing a file isn't too useful, because an OFFile
    object can't be reused, whereas an OFTCPSocket can. So only the
    OFTCPSocket should have closed. Plus, we don't need to handle the case
    that someone tried to read from / write to a closed OFFile. (user: js, size: 1622) [annotate] [blame] [check-ins using]

To Artifact [59b06f95cb]:


1
2
3
4
5
6
7
8
9
10
11
12
13




14
15
16


17
18
19
20










21
22
23
24
25
26
27
/*
 * Copyright (c) 2008
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of libobjfw. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import <stdio.h>





#import <sys/types.h>
#import <sys/socket.h>
#import <netdb.h>



#import "OFObject.h"
#import "OFStream.h"











/**
 * The OFTCPSocket class provides functions to create and use sockets.
 */
@interface OFTCPSocket: OFObject <OFStream>
{
	int sock;
	struct sockaddr *saddr;













>
>
>
>



>
>




>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * Copyright (c) 2008
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of libobjfw. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import <stdio.h>

/*
 * Headers for UNIX systems
 */
#ifndef _WIN32
#import <sys/types.h>
#import <sys/socket.h>
#import <netdb.h>
#else
#endif

#import "OFObject.h"
#import "OFStream.h"

/*
 * Headers for Win32
 *
 * These must be imported after objc/Object and thus OFObject!
 */
#ifdef _WIN32
#import <winsock2.h>
#import <ws2tcpip.h>
#endif

/**
 * The OFTCPSocket class provides functions to create and use sockets.
 */
@interface OFTCPSocket: OFObject <OFStream>
{
	int sock;
	struct sockaddr *saddr;