ObjFW  Diff

Differences From Artifact [ab1097e618]:

To Artifact [2694d5248b]:


37
38
39
40
41
42
43
44
45
46
47


48
49
50
51
52
53
54
55


56
57
58
59
60

61
62
63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
78
79
80
37
38
39
40
41
42
43




44
45
46
47
48
49




50
51
52
53
54
55

56
57


58
59
60
61
62
63

64
65


66
67
68
69
70
71
72







-
-
-
-
+
+




-
-
-
-
+
+




-
+

-
-






-
+

-
-







	FD_ZERO(&writeFDs);

	FD_SET(cancelFD[0], &readFDs);

	return self;
}

- (void)_addStreamForReading: (OFStream*)stream
{
	int fd = [stream fileDescriptor];

- (void)_addFileDescriptorForReading: (int)fd
{
	FD_SET(fd, &readFDs);
	FD_SET(fd, &exceptFDs);
}

- (void)_addStreamForWriting: (OFStream*)stream
{
	int fd = [stream fileDescriptor];

- (void)_addFileDescriptorForWriting: (int)fd
{
	FD_SET(fd, &writeFDs);
	FD_SET(fd, &exceptFDs);
}

- (void)_removeStreamForReading: (OFStream*)stream
- (void)_removeFileDescriptorForReading: (int)fd
{
	int fd = [stream fileDescriptor];

	FD_CLR(fd, &readFDs);

	if (!FD_ISSET(fd, &writeFDs))
		FD_CLR(fd, &exceptFDs);
}

- (void)_removeStreamForWriting: (OFStream*)stream
- (void)_removeFileDescriptorForWriting: (int)fd
{
	int fd = [stream fileDescriptor];

	FD_CLR(fd, &writeFDs);

	if (!FD_ISSET(fd, &readFDs))
		FD_CLR(fd, &exceptFDs);
}

- (BOOL)observeWithTimeout: (int)timeout