Lines Matching refs:data

238         __u8    can_dlc; /* data length code: 0 .. 8 */
239 __u8 data[8] __attribute__((aligned(8)));
474 # RDS sockets must be bound explicitly to send or receive data
2103 def build_can_frame(cls, can_id, data):
2105 can_dlc = len(data)
2106 data = data.ljust(8, b'\x00')
2107 return struct.pack(cls.can_frame_fmt, can_id, can_dlc, data)
2112 can_id, can_dlc, data = struct.unpack(cls.can_frame_fmt, frame)
2113 return (can_id, can_dlc, data[:can_dlc])
2151 can_id, can_dlc, data = self.dissect_can_frame(cf)
2153 self.assertEqual(self.data, data)
2162 self.data = bytes([0xc0, 0xff, 0xee])
2163 self.cf = self.build_can_frame(self.can_id, self.data)
2321 data, addr = self.serv.recvfrom(self.bufsize)
2322 self.assertEqual(self.data, data)
2326 self.data = b'spam'
2327 self.cli.sendto(self.data, 0, (HOST, self.port))
2330 data, addr = self.serv.recvfrom(self.bufsize, socket.MSG_PEEK)
2331 self.assertEqual(self.data, data)
2332 data, addr = self.serv.recvfrom(self.bufsize)
2333 self.assertEqual(self.data, data)
2336 self.data = b'spam'
2337 self.cli.sendto(self.data, 0, (HOST, self.port))
2341 data, ancdata, msg_flags, addr = self.serv.recvmsg(self.bufsize)
2342 self.assertEqual(self.data, data)
2346 self.data = b'hello ' * 10
2347 self.cli.sendmsg([self.data], (), 0, (HOST, self.port))
2350 data, addr = self.serv.recvfrom(self.bufsize)
2351 self.assertEqual(self.data1, data)
2353 data, addr = self.serv.recvfrom(self.bufsize)
2354 self.assertEqual(self.data2, data)
2366 data, addr = self.serv.recvfrom(self.bufsize)
2367 self.assertEqual(self.data, data)
2370 self.data = b'select'
2371 self.cli.sendto(self.data, 0, (HOST, self.port))
2739 # on the returned ancillary data, for instance.
2915 # Gather (empty) ancillary data from a generator.
2923 # Send data from an array instead of the usual bytes object.
2931 # Send message data from more than one buffer (gather write).
2960 # Check that invalid ancillary data items are rejected.
2967 [MSG], [(object(), 0, b"data")])
2969 [MSG], [(0, object(), b"data")])
2975 [MSG], [(0, 0, b"data", 42)])
2980 # Check that invalid ancillary data items are rejected when
2993 # Check that sendmsg() rejects excess ancillary data items
3144 # Test ancillary data buffer too small to hold any ancillary data.
3156 # Test large ancillary data buffer.
3190 # data without consuming it.
3192 # Receive part of data with MSG_PEEK.
3206 # Receive all data with MSG_PEEK.
3215 # Check that the same data can still be received normally.
3410 # This is how recvmsg() calculates the data size
3476 # Close all file descriptors specified in the ancillary data
3489 # server, with the constant MSG as the non-ancillary data.
3623 # call fails, just send msg with no ancillary data.
3697 # Check that no ancillary data items are returned when data is
3707 # Check that no ancillary data is received when no buffer size
3719 # Check that no ancillary data is received when buffer size is 0.
3726 # Check that no ancillary data is returned for various non-zero
3738 # data.
3756 # Check that file descriptor data is truncated to between
3807 # Test sendmsg() and recvmsg[_into]() using the ancillary data
3809 # Currently we can only handle certain data items (e.g. traffic
3812 # but the tests here are aimed at testing the ancillary data
3824 # Given ancillary data list ancdata, return a mapping from
3834 # Receive hop limit into ancbufsize bytes of ancillary data
3835 # space. Check that data is MSG, ancillary data is not
3863 # Test receiving the packet hop limit as ancillary data.
3869 # data, as implementations are not required to buffer it
3908 # ancillary data space. Check that data is MSG, ancillary
3909 # data is not truncated (but ignore any flags in ignoreflags),
3944 # Test receiving traffic class and hop limit as ancillary data.
3989 # Try to send ancillary data with first item one byte too
4015 # Tests for proper handling of truncated ancillary data
4018 # Receive hop limit into ancbufsize bytes of ancillary data
4020 # data header (if ancbufsize is None, pass no second argument
4021 # to recvmsg()). Check that data is MSG, MSG_CTRUNC is set
4022 # (unless included in ignoreflags), and no ancillary data is
4039 # Check that no ancillary data is received when no ancillary
4055 # Check that no ancillary data is received when ancillary
4065 # Check that no ancillary data is returned for various non-zero
4098 # data. The message may be returned with its data truncated,
4124 # ancillary data space, which should be large enough to
4126 # of the second. Check that data is MSG, MSG_CTRUNC is set
4128 # data item is returned.
4201 # its associated data.
4809 # the server didn't send data yet: non-blocking recv() fails
4819 # the server sent data yet: non-blocking recv() doesn't block
4830 # send data: recv() will no longer block
5003 object, read another line from it, without loss of data in the
5089 # The first write() succeeds since a chunk of data can be buffered
5333 data = sock.recv(5)
5334 self.assertEqual(data, b"done!")
5791 data = conn.recv(1024)
5792 conn.sendall(data)
5805 data = conn.recv(1024)
5806 conn.sendall(data)
5952 # Recreate socket from shared data
5973 # Get the shared socket data
5974 data = self.serv.share(p.pid)
5979 q.put(data)
5981 # The data that the server will send us
5987 # listen for the data
5990 data = s.recv(100)
5991 if not data:
5993 m.append(data)
6000 data = self.serv.share(os.getpid())
6001 self.assertRaises(ValueError, socket.fromshare, data[:-1])
6002 self.assertRaises(ValueError, socket.fromshare, data+b"foo")
6021 data = self.serv.share(os.getpid())
6022 s = socket.fromshare(data)
6038 data = source.share(os.getpid())
6039 shared = socket.fromshare(data)
6115 data = self.recv_data(conn)
6116 self.assertEqual(len(data), self.FILESIZE)
6117 self.assertEqual(data, self.FILEDATA)
6133 data = self.recv_data(conn)
6134 self.assertEqual(len(data), self.FILESIZE)
6135 self.assertEqual(data, self.FILEDATA)
6153 data = self.recv_data(conn)
6154 self.assertEqual(data, b"")
6169 data = self.recv_data(conn)
6170 self.assertEqual(len(data), self.FILESIZE - 5000)
6171 self.assertEqual(data, self.FILEDATA[5000:])
6190 data = self.recv_data(conn)
6191 self.assertEqual(len(data), count)
6192 self.assertEqual(data, self.FILEDATA[:count])
6211 data = self.recv_data(conn)
6212 self.assertEqual(len(data), count)
6213 self.assertEqual(data, self.FILEDATA[:count])
6230 data = self.recv_data(conn)
6231 self.assertEqual(len(data), count)
6232 self.assertEqual(data, self.FILEDATA[2007:count+2007])
6248 self.fail('was not supposed to receive any data')
6264 data = self.recv_data(conn)
6265 self.assertEqual(len(data), self.FILESIZE)
6266 self.assertEqual(data, self.FILEDATA)
6447 # create anc data manually
6686 # request more data and file descriptors than expected
6701 data = os.read(rfd, 100)
6702 self.assertEqual(data, str(index).encode())