PageRenderTime 537ms queryTime 130ms sortTime 1ms getByIdsTime 110ms findMatchingLines 176ms

100+ results results for 'MSG_PEEK repo:gitpan/IO-Socket-TIPC' (537 ms)

Not the results you expected?
toc-bert_rpr.rpc-module.html https://github.com/DwayneDibley/BERT-RPR.git | HTML | 155 lines
                    
88     >MSG_DONTROUTE</a><br />    <a target="mainFrame" href="bert_rpr.rpc-module.html#MSG_OOB"
                    
89     >MSG_OOB</a><br />    <a target="mainFrame" href="bert_rpr.rpc-module.html#MSG_PEEK"
                    
90     >MSG_PEEK</a><br />    <a target="mainFrame" href="bert_rpr.rpc-module.html#MSG_TRUNC"
                    
                
datagram.c https://github.com/gtvhacker/Logitech-Revue.git | C | 535 lines
                    
167		 */
                    
168		if (flags & MSG_PEEK) {
                    
169			unsigned long cpu_flags;
                    
212 *
                    
213 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
214 *	receive queue of the socket, it will be taken off the queue
                    
223{
                    
224	if (flags & MSG_PEEK) {
                    
225		spin_lock_bh(&sk->sk_receive_queue.lock);
                    
                
AsyncFile.py git://pkgs.fedoraproject.org/eric | Python | 293 lines
                    
178        # read a line at a time.
                    
179        line = self.sock.recv(size, socket.MSG_PEEK)
                    
180
                    
                
kernel_netlink_shared.c git://pkgs.fedoraproject.org/strongswan | C | 307 lines
                    
163		 * numbers to detect multi header messages */
                    
164		len = recvfrom(this->socket, &peek, sizeof(peek), MSG_PEEK | MSG_DONTWAIT,
                    
165					   (struct sockaddr*)&addr, &addr_len);
                    
                
vchi.h https://gitlab.com/kush/linux | C Header | 238 lines
                    
132// will return the same message.
                    
133extern int32_t vchi_msg_peek(VCHI_SERVICE_HANDLE_T handle,
                    
134			     void **data,
                    
                
socket_base.hpp https://gitlab.com/cdeclare/intcrypt | C++ Header | 522 lines
                    
69  BOOST_ASIO_STATIC_CONSTANT(int,
                    
70      message_peek = BOOST_ASIO_OS_DEF(MSG_PEEK));
                    
71  BOOST_ASIO_STATIC_CONSTANT(int,
                    
                
ospf6_network.c https://github.com/labx-technologies-llc/mb-linux-labx.git | C | 501 lines
                    
458void
                    
459ospf6_recvmsg_peek (struct in6_addr *src, struct in6_addr *dst,
                    
460                    unsigned int *ifindex, struct iovec *message)
                    
486
                    
487  retval = recvmsg (ospf6_sock, &rmsghdr, MSG_PEEK);
                    
488  if (retval != iov_totallen (message))
                    
                
sock.c https://github.com/hackndev/linux-hnd.git | C | 388 lines
                    
112
                    
113	result = _recvfrom(socket, header, 4, MSG_PEEK);
                    
114	if (result == -EAGAIN)
                    
                
TCP.cpp https://gitlab.com/piconf/software.git | C++ | 308 lines
                    
104void VIO::TCP::read() {
                    
105	int bytes = recv(fd, destinations.front().data, destinations.front().left, destinations.front().size ? 0 : MSG_PEEK);
                    
106	if (0 > bytes)
                    
                
owsl_tcp.c https://github.com/VoxOx/VoxOx.git | C | 330 lines
                    
66	/* get packet and packet size */
                    
67	received_bytes = recv (socket->system_socket, buffer, OWSL_TCP_BUFFER_SIZE, MSG_PEEK) ;
                    
68	if (received_bytes > 0)
                    
                
poll.c https://gitlab.com/nmusco/git | C | 614 lines
                    
71
                    
72/* BeOS does not have MSG_PEEK.  */
                    
73#ifndef MSG_PEEK
                    
73#ifndef MSG_PEEK
                    
74# define MSG_PEEK 0
                    
75#endif
                    
244      WSASetLastError (0);
                    
245      r = recv (h, data, sizeof (data), MSG_PEEK);
                    
246      error = WSAGetLastError ();
                    
282# if defined __MACH__ && defined __APPLE__
                    
283      /* There is a bug in Mac OS X that causes it to ignore MSG_PEEK
                    
284	 for some kinds of descriptors.  Detect if this descriptor is a
                    
286	 0-byte recv, and use ioctl(2) to detect POLLHUP.  */
                    
287      r = recv (fd, NULL, 0, MSG_PEEK);
                    
288      socket_errno = (r < 0) ? errno : 0;
                    
                
RubySocket.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 605 lines
                    
96        rb_mConstants.setConstant("MSG_OOB", runtime.newFixnum(MSG_OOB));
                    
97        rb_mConstants.setConstant("MSG_PEEK", runtime.newFixnum(MSG_PEEK));
                    
98        rb_mConstants.setConstant("MSG_DONTROUTE", runtime.newFixnum(MSG_DONTROUTE));
                    
                
ngx_http_ajp_msg.c https://github.com/yaoweibin/nginx_ajp_module.git | C | 482 lines
                    
244ngx_int_t
                    
245ajp_msg_peek_uint16(ajp_msg_t *msg, uint16_t *rvalue)
                    
246{
                    
252    if ((buf->pos + 2) > buf->last) {
                    
253        return ajp_log_overflow(msg, "ajp_msg_peek_uint16");
                    
254    }
                    
265ngx_int_t
                    
266ajp_msg_peek_uint8(ajp_msg_t *msg, u_char *rvalue)
                    
267{
                    
268    if ((msg->buf->pos + 1) > msg->buf->last) {
                    
269        return ajp_log_overflow(msg, "ajp_msg_peek_uint8");
                    
270    }
                    
                
socket.h https://gitlab.com/gl-xinshouyong/1407-mifi-customer-tmp | C Header | 221 lines
                    
24#define NL_OWN_PORT		(1<<2)
                    
25#define NL_MSG_PEEK		(1<<3)
                    
26#define NL_NO_AUTO_ACK		(1<<4)
                    
151/**
                    
152 * Enable use of MSG_PEEK when reading from socket
                    
153 * @arg sk		Netlink socket.
                    
154 */
                    
155static inline void nl_socket_enable_msg_peek(struct nl_sock *sk)
                    
156{
                    
156{
                    
157	sk->s_flags |= NL_MSG_PEEK;
                    
158}
                    
160/**
                    
161 * Disable use of MSG_PEEK when reading from socket
                    
162 * @arg sk		Netlink socket.
                    
                
PlainDatagramSocketImpl.java https://github.com/TaintDroid/android_platform_libcore.git | Java | 240 lines
                    
173    public int peekData(DatagramPacket pack) throws IOException {
                    
174        doRecv(pack, MSG_PEEK);
                    
175        return pack.getPort();
                    
                
vsock_test.c git://github.com/torvalds/linux.git | C | 456 lines
                    
252
                    
253static void test_stream_msg_peek_client(const struct test_opts *opts)
                    
254{
                    
266
                    
267static void test_stream_msg_peek_server(const struct test_opts *opts)
                    
268{
                    
276
                    
277	recv_byte(fd, 1, MSG_PEEK);
                    
278	recv_byte(fd, 1, 0);
                    
307	{
                    
308		.name = "SOCK_STREAM MSG_PEEK",
                    
309		.run_client = test_stream_msg_peek_client,
                    
309		.run_client = test_stream_msg_peek_client,
                    
310		.run_server = test_stream_msg_peek_server,
                    
311	},
                    
                
ipc_router_socket.c https://gitlab.com/webhaikal/SenseiOneplus3 | C | 693 lines
                    
387	if (!buf_len) {
                    
388		if (flags & MSG_PEEK)
                    
389			ret = msm_ipc_router_get_curr_pkt_size(port_ptr);
                    
                
datagram.c https://gitlab.com/webhaikal/SenseiOneplus3 | C | 884 lines
                    
194			*peeked = skb->peeked;
                    
195			if (flags & MSG_PEEK) {
                    
196				if (_off >= skb->len && (skb->len || _off ||
                    
276 *
                    
277 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
278 *	receive queue of the socket, it will be taken off the queue
                    
291
                    
292	if (flags & MSG_PEEK) {
                    
293		err = -ENOENT;
                    
                
socket.c https://gitlab.com/webhaikal/SenseiOneplus3 | C | 834 lines
                    
156	if (len < copied) {
                    
157		if (flags & MSG_PEEK)
                    
158			atomic_dec(&skb->users);
                    
                
os_socket.h git://github.com/insider42/mangos.git | C Header | 307 lines
                    
154
                    
155#if !defined (MSG_PEEK)
                    
156#  define MSG_PEEK 0x2
                    
156#  define MSG_PEEK 0x2
                    
157#endif /* MSG_PEEK */
                    
158
                    
                
socket_posix.cc https://gitlab.com/hkratz/chromium | C++ | 487 lines
                    
200  char c;
                    
201  int rv = HANDLE_EINTR(recv(socket_fd_, &c, 1, MSG_PEEK));
                    
202  if (rv == 0)
                    
218  char c;
                    
219  int rv = HANDLE_EINTR(recv(socket_fd_, &c, 1, MSG_PEEK));
                    
220  if (rv >= 0)
                    
                
_remote_socket.py https://gitlab.com/gregtyka/frankenserver | Python | 1183 lines
                    
62
                    
63MSG_PEEK = 2
                    
64MSG_WAITALL = 256
                    
                
test_sockmap.c https://gitlab.com/kush/linux | C | 1849 lines
                    
445{
                    
446	struct msghdr msg = {0}, msg_peek = {0};
                    
447	int err, i, flags = MSG_NOSIGNAL;
                    
454	if (peek_flag) {
                    
455		err = msg_alloc_iov(&msg_peek, iov_count, iov_length, data, tx);
                    
456		if (err)
                    
530			if (peek_flag) {
                    
531				flags |= MSG_PEEK;
                    
532				recvp = recvmsg(fd, &msg_peek, flags);
                    
563				if (recvp) {
                    
564					errno = msg_verify_data(&msg_peek,
                    
565								recvp,
                    
567					if (errno) {
                    
568						perror("data verify msg_peek failed\n");
                    
569						goto out_errno;
                    
                
recvmsg.c https://gitlab.com/kush/linux | C | 761 lines
                    
120
                    
121	if (ret == 0 && !(flags & MSG_PEEK)) {
                    
122		_debug("to be accepted");
                    
345
                    
346		if (!(flags & MSG_PEEK))
                    
347			trace_rxrpc_receive(call, rxrpc_receive_front,
                    
396		last = sp->hdr.flags & RXRPC_LAST_PACKET;
                    
397		if (!(flags & MSG_PEEK))
                    
398			rxrpc_rotate_rx_window(call);
                    
411out:
                    
412	if (!(flags & MSG_PEEK)) {
                    
413		call->rx_pkt_offset = rx_pkt_offset;
                    
491	call = list_entry(l, struct rxrpc_call, recvmsg_link);
                    
492	if (!(flags & MSG_PEEK))
                    
493		list_del_init(&call->recvmsg_link);
                    
                
tcp_bpf.c https://gitlab.com/kush/linux | C | 691 lines
                    
45	struct iov_iter *iter = &msg->msg_iter;
                    
46	int peek = flags & MSG_PEEK;
                    
47	int i, ret, copied = 0;
                    
                
datagram.c https://gitlab.com/kush/linux | C | 800 lines
                    
176
                    
177	if (unlikely(flags & MSG_PEEK && *off >= 0)) {
                    
178		peek_at_off = true;
                    
183	skb_queue_walk(queue, skb) {
                    
184		if (flags & MSG_PEEK) {
                    
185			if (peek_at_off && _off >= skb->len &&
                    
359
                    
360	if (flags & MSG_PEEK) {
                    
361		err = -ENOENT;
                    
387 *
                    
388 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
389 *	receive queue of the socket, it will be taken off the queue
                    
                
vchiq_shim.c https://gitlab.com/kush/linux | C | 759 lines
                    
23/***********************************************************
                    
24 * Name: vchi_msg_peek
                    
25 *
                    
38 ***********************************************************/
                    
39int32_t vchi_msg_peek(VCHI_SERVICE_HANDLE_T handle,
                    
40	void **data,
                    
60}
                    
61EXPORT_SYMBOL(vchi_msg_peek);
                    
62
                    
68 * Description: Routine to remove a message (after it has been read with
                    
69 *              vchi_msg_peek)
                    
70 *
                    
                
socket.c https://gitlab.com/kush/linux | C | 833 lines
                    
156	if (len < copied) {
                    
157		if (flags & MSG_PEEK)
                    
158			refcount_dec(&skb->users);
                    
                
socket_types.hpp https://gitlab.com/cdeclare/intcrypt | C++ Header | 406 lines
                    
133# define BOOST_ASIO_OS_DEF_MSG_OOB 0x1
                    
134# define BOOST_ASIO_OS_DEF_MSG_PEEK 0x2
                    
135# define BOOST_ASIO_OS_DEF_MSG_DONTROUTE 0x4
                    
217# define BOOST_ASIO_OS_DEF_MSG_OOB MSG_OOB
                    
218# define BOOST_ASIO_OS_DEF_MSG_PEEK MSG_PEEK
                    
219# define BOOST_ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE
                    
332# define BOOST_ASIO_OS_DEF_MSG_OOB MSG_OOB
                    
333# define BOOST_ASIO_OS_DEF_MSG_PEEK MSG_PEEK
                    
334# define BOOST_ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE
                    
                
libnetlink.c https://gitlab.com/abhishekr700/ASUS_ZenFone_ZE550KL | C | 691 lines
                    
132	/* Check for immediate errors */
                    
133	status = recv(rth->fd, resp, sizeof(resp), MSG_DONTWAIT|MSG_PEEK);
                    
134	if (status < 0) {
                    
                
Connection.py https://gitlab.com/cyrixhero/ZeroNet | Python | 450 lines
                    
114            try:
                    
115                if sock.recv(1, gevent.socket.MSG_PEEK) == "\x16":
                    
116                    self.log("Crypt in connection using implicit SSL")
                    
                
socket.c git://pkgs.fedoraproject.org/cntlm | C | 284 lines
                    
210	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
                    
211	i = recv(fd, &buf, 1, MSG_PEEK);
                    
212	fcntl(fd, F_SETFL, flags);
                    
213#else
                    
214	i = recv(fd, &buf, 1, MSG_DONTWAIT | MSG_PEEK);
                    
215#endif
                    
                
fh_tcp.c https://github.com/csinitiative/fhce.git | C | 623 lines
                    
405
                    
406        if (flags != MSG_PEEK) {
                    
407            nleft -= nread;
                    
504
                    
505        if (flags != MSG_PEEK) {
                    
506            nleft -= nread;
                    
543{
                    
544    return fh_tcp_readex(s, buf, nbytes, MSG_PEEK);
                    
545}
                    
                
ar-recvmsg.c https://gitlab.com/deadnem/Singularity | C | 442 lines
                    
89			if (copied &&
                    
90			    (flags & MSG_PEEK || timeo == 0))
                    
91				goto out;
                    
201
                    
202		if (!(flags & MSG_PEEK))
                    
203			sp->offset = offset;
                    
220			/* last bit of request received */
                    
221			if (!(flags & MSG_PEEK)) {
                    
222				_debug("eat packet");
                    
239
                    
240		if (flags & MSG_PEEK) {
                    
241			_debug("peek next");
                    
274			goto copy_error;
                    
275		if (!(flags & MSG_PEEK)) {
                    
276			if (skb_dequeue(&rx->sk.sk_receive_queue) != skb)
                    
                
library.c https://gitlab.com/oytunistrator/phpredis | C | 1732 lines
                    
145     * There is a bug in php socket stream to check liveness of a connection:
                    
146     * if (0 >= recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) {
                    
147     *    alive = 0;
                    
                
datagram.c https://gitlab.com/bsd1993/android_kernel_zte_x9180 | C | 780 lines
                    
188			*peeked = skb->peeked;
                    
189			if (flags & MSG_PEEK) {
                    
190				if (*off >= skb->len) {
                    
265 *
                    
266 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
267 *	receive queue of the socket, it will be taken off the queue
                    
280
                    
281	if (flags & MSG_PEEK) {
                    
282		err = -ENOENT;
                    
                
LSOCK.cpp https://bitbucket.org/oregon/oregoncore/ | C++ | 184 lines
                    
134                                    &recv_msg,
                    
135                                    MSG_PEEK);
                    
136
                    
143#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG)
                    
144          // Close down the socket that was returned by the MSG_PEEK.
                    
145          cmsghdr  *cmsgptr = (cmsghdr *) cmsgbuf;
                    
                
socket.scm https://code.google.com/p/sagittarius-scheme/ | Scheme | 92 lines
                    
62	    MSG_OOB
                    
63	    MSG_PEEK
                    
64	    MSG_DONTROUTE
                    
                
ofxTCPManager.cpp https://gitlab.com/cocoroac/walkingartists | C++ | 605 lines
                    
111    char buffer;
                    
112    int ret = recv(m_hSocket, &buffer, 1, MSG_PEEK);
                    
113    SetNonBlocking(wasBlocking);
                    
433 
                    
434	return recv(m_hSocket, pBuff, iSize, MSG_PEEK);
                    
435}
                    
                
extconf.rb https://gitlab.com/smoke.torez/ruby | Ruby | 676 lines
                    
124
                    
125RECVMSG_WITH_MSG_PEEK_ALLOCATE_FD_TEST = <<'EOF'
                    
126#include <stdlib.h>
                    
193
                    
194    ss = recvmsg(sv[1], &r_msg, MSG_PEEK);
                    
195    if (ss == -1) { perror("recvmsg"); exit(EXIT_FAILURE); }
                    
245
                    
246def test_recvmsg_with_msg_peek_creates_fds(headers)
                    
247  case RUBY_PLATFORM
                    
248  when /linux/
                    
249    # Linux 2.6.38 allocate fds by recvmsg with MSG_PEEK.
                    
250    close_fds = true
                    
252    # FreeBSD 8.2.0, NetBSD 5 and MacOS X Snow Leopard doesn't
                    
253    # allocate fds by recvmsg with MSG_PEEK.
                    
254    # [ruby-dev:44189]
                    
                
socket.c https://gitlab.com/unlogic/radare-mirror | C | 775 lines
                    
109	r_socket_block_time (s, 0, 0);
                    
110	ssize_t ret = recv (s->fd, (char*)&buf, 1, MSG_PEEK);
                    
111	r_socket_block_time (s, 1, 0);
                    
114	char buf[2];
                    
115	int ret = recv (s->fd, &buf, 1, MSG_PEEK | MSG_DONTWAIT);
                    
116	return ret? true: false;
                    
                
socket.h https://gitlab.com/buildchain/newlib-cygwin | C Header | 326 lines
                    
204#define MSG_OOB         0x1             /* process out-of-band data */
                    
205#define MSG_PEEK        0x2             /* peek at incoming message */
                    
206#define MSG_DONTROUTE   0x4             /* send without using routing tables */
                    
                
sock.c https://gitlab.com/Orvillo/Tomato | C | 935 lines
                    
128		result = _recvfrom(socket, (void *) peek_buf, 1,
                    
129				   MSG_PEEK | MSG_DONTWAIT);
                    
130		if (result < 0)
                    
                
io.cpp https://gitlab.com/wilane/mesos | C++ | 608 lines
                    
75      // Windows use `char*` instead of `void*`.
                    
76      length = ::recv(fd, (char*) data, size, MSG_PEEK);
                    
77    }
                    
                
watchman.c https://gitlab.com/lemonxah/vim | C | 675 lines
                    
18#include <sys/errno.h>  /* for errno */
                    
19#include <sys/socket.h> /* for recv(), MSG_PEEK */
                    
20
                    
                
svcsock.c https://gitlab.com/rychly/nst-linux-sources | C | 1319 lines
                    
453	err = kernel_recvmsg(svsk->sk_sock, &msg, NULL,
                    
454			     0, 0, MSG_PEEK | MSG_DONTWAIT);
                    
455	if (err >= 0)
                    
                
datagram.c https://gitlab.com/rychly/nst-linux-sources | C | 650 lines
                    
173			*peeked = skb->peeked;
                    
174			if (flags & MSG_PEEK) {
                    
175				skb->peeked = 1;
                    
224 *
                    
225 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
226 *	receive queue of the socket, it will be taken off the queue
                    
239
                    
240	if (flags & MSG_PEEK) {
                    
241		err = -ENOENT;
                    
                
svcsock.c https://gitlab.com/rychly/rk3026-linux-sources | C | 1663 lines
                    
576	err = kernel_recvmsg(svsk->sk_sock, &msg, NULL,
                    
577			     0, 0, MSG_PEEK | MSG_DONTWAIT);
                    
578	if 
                    
                
tcp.pl https://github.com/wtj/formosa.git | Perl | 476 lines
                    
100    eval 'sub MSG_OOB {0x1;}';
                    
101    eval 'sub MSG_PEEK {0x2;}';
                    
102    eval 'sub MSG_DONTROUTE {0x4;}';
                    
                
netdefs.c https://github.com/openj/core.git | C | 239 lines
                    
142	printf ("MSG_OOB=: %d\n",(int)MSG_OOB);
                    
143	printf ("MSG_PEEK=: %d\n",(int)MSG_PEEK);
                    
144	printf ("MSG_DONTROUTE=: %d\n",(int)MSG_DONTROUTE);
                    
                
BenchmarkSsl.py https://gitlab.com/cyrixhero/ZeroNet | Python | 162 lines
                    
29    # sock = ctx.wrap_socket(sock, server_side=True)
                    
30    # if sock_raw.recv( 1, gevent.socket.MSG_PEEK ) == "\x16":
                    
31    #   sock = gevent.ssl.wrap_socket(sock_raw, server_side=True, keyfile='key-cz.pem',
                    
                
socket_base.hpp https://gitlab.com/Teo-Mirror/AtomicGameEngine | C++ Header | 520 lines
                    
68  ASIO_STATIC_CONSTANT(int,
                    
69      message_peek = ASIO_OS_DEF(MSG_PEEK));
                    
70  ASIO_STATIC_CONSTANT(int,
                    
                
datagram.c https://gitlab.com/bsd1993/android_kernel_zte_x9180 | C | 215 lines
                    
137
                    
138	if (flags & ~(MSG_PEEK|MSG_TRUNC|MSG_DONTWAIT|MSG_NOSIGNAL|
                    
139			MSG_CMSG_COMPAT))
                    
                
socket_types.hpp http://ilogic-vm.googlecode.com/svn/trunk/ | C++ Header | 209 lines
                    
148const int shutdown_both = SD_BOTH;
                    
149const int message_peek = MSG_PEEK;
                    
150const int message_out_of_band = MSG_OOB;
                    
187const int shutdown_both = SHUT_RDWR;
                    
188const int message_peek = MSG_PEEK;
                    
189const int message_out_of_band = MSG_OOB;
                    
                
glibconfig-x86.h https://bitbucket.org/jnbek/pchat-dev | C Header | 227 lines
                    
220#define GLIB_SYSDEF_MSG_OOB 1
                    
221#define GLIB_SYSDEF_MSG_PEEK 2
                    
222#define GLIB_SYSDEF_MSG_DONTROUTE 4
                    
                
vchi.h git://github.com/torvalds/linux.git | C Header | 240 lines
                    
133// will return the same message.
                    
134extern int32_t vchi_msg_peek(struct vchi_service_handle *handle,
                    
135			     void **data,
                    
                
socket.d git://github.com/SiegeLord/Tango-D2.git | D | 498 lines
                    
95MSG_OOB
                    
96MSG_PEEK
                    
97MSG_TRUNC
                    
                
slp_network.c https://openslp.svn.sourceforge.net/svnroot/openslp | C | 383 lines
                    
288                             16,
                    
289                             MSG_PEEK,
                    
290                             (struct sockaddr *)peeraddr,
                    
                
test_sockmap.c git://github.com/torvalds/linux.git | C | 1853 lines
                    
449{
                    
450	struct msghdr msg = {0}, msg_peek = {0};
                    
451	int err, i, flags = MSG_NOSIGNAL;
                    
458	if (peek_flag) {
                    
459		err = msg_alloc_iov(&msg_peek, iov_count, iov_length, data, tx);
                    
460		if (err)
                    
534			if (peek_flag) {
                    
535				flags |= MSG_PEEK;
                    
536				recvp = recvmsg(fd, &msg_peek, flags);
                    
567				if (recvp) {
                    
568					errno = msg_verify_data(&msg_peek,
                    
569								recvp,
                    
571					if (errno) {
                    
572						perror("data verify msg_peek failed");
                    
573						goto out_errno;
                    
                
socket.rs git://github.com/djehuty/ibis.git | Rust | 658 lines
                    
116  /*pub enum RecvOptions {
                    
117    MSG_PEEK     = 0x2,
                    
118    MSG_DONTWAIT = 0x40,
                    
                
vpServer.cpp https://github.com/thomas-moulard/visp-deb.git | C++ | 284 lines
                    
256#ifdef UNIX
                    
257          int numbytes = recv(receptor_list[i].socketFileDescriptorReceptor, &deco, 1, MSG_PEEK);
                    
258#else //Win32
                    
258#else //Win32
                    
259          int numbytes = recv((unsigned int)receptor_list[i].socketFileDescriptorReceptor, &deco, 1, MSG_PEEK);
                    
260#endif
                    
                
IN.py https://github.com/labx-technologies-llc/mb-linux-labx.git | Python | 430 lines
                    
145MSG_OOB = 1
                    
146MSG_PEEK = 2
                    
147MSG_DONTROUTE = 4
                    
                
msg.c https://quake.svn.sourceforge.net/svnroot/quake | C | 382 lines
                    
372int
                    
373MSG_PeekByte (msg_t *msg)
                    
374{
                    
                
mod_jaxer_message.h https://github.com/aptana/Jaxer.git | C Header | 150 lines
                    
105	 */
                    
106    int jxr_msg_peek_int16(unsigned char* buf, apr_size_t pos);
                    
107
                    
108    char jxr_msg_get_byte(unsigned char* buf, apr_size_t *pos);  
                    
109    char jxr_msg_peek_byte(unsigned char* buf, apr_size_t *pos);
                    
110
                    
                
win32-constants.lisp git://github.com/antifuchs/sbcl.git | Lisp | 234 lines
                    
55 (:integer msg-oob "MSG_OOB")
                    
56 (:integer msg-peek "MSG_PEEK")
                    
57 (:integer msg-dontroute "MSG_DONTROUTE")
                    
                
Test.pm https://github.com/bestpractical/net-imap-server.git | Perl | 229 lines
                    
90    # not under a layer version, anyways.
                    
91    my $waiting = recv($socket, $buf, 1, MSG_PEEK | MSG_DONTWAIT);
                    
92
                    
                
sockets.h https://github.com/meriac/openbeacon.git | C Header | 346 lines
                    
134/* Flags we can use with send and recv. */
                    
135#define MSG_PEEK       0x01	/* Peeks at an incoming message */
                    
136#define MSG_WAITALL    0x02	/* Unimplemented: Requests that the function block until the full amount of data requested can be returned */
                    
                
netstring.c https://gitlab.com/javajamesb08/kamailio.git | C | 198 lines
                    
44	/* Peek at first 10 bytes, to get length and colon */
                    
45	bytes = recv(fd,buffer,10,MSG_PEEK);
                    
46
                    
                
rtph264.c https://github.com/gigijoe/rtph264.git | C | 340 lines
                    
122    memset(buf, 0, 64);
                    
123    int r = recv(sfd, buf, sizeof(rtp_hdr_t) + 8, MSG_PEEK);  /*  Peek data from socket, so that we could determin how to read data from socket*/
                    
124    if(r <= sizeof(rtp_hdr_t) || r == -1)  {
                    
                
ByteStringSpec.hs git://github.com/haskell/network.git | Haskell | 308 lines
                    
226                    (_, msgs, _, _flags) <- recvMsg sock 1024 0 MSG_PEEK
                    
227                    -- flags .&. MSG_PEEK `shouldBe` MSG_PEEK -- Mac only
                    
228                    (_, msgs', _, _) <- recvMsg sock 1024 0 mempty
                    
                
rpclocal.c git://pkgs.fedoraproject.org/ocaml-ocamlnet | C | 256 lines
                    
161
                    
162	if (recvmsg(Int_val(fd), &msg, MSG_PEEK) < 0) {
                    
163	    uerror("recvmsg", Nothing);
                    
219
                    
220	if (recvmsg(Int_val(fd), &msg, MSG_PEEK) < 0) {
                    
221	    stat_free(crmsg);
                    
                
ph.t http://perl5005.googlecode.com/svn/trunk/ | Perl | 97 lines
                    
17    AF_SNA AF_UNIX AF_UNSPEC AF_X25 MSG_DONTROUTE MSG_MAXIOVLEN MSG_OOB
                    
18    MSG_PEEK PF_802 PF_APPLETALK PF_CCITT PF_CHAOS PF_DATAKIT PF_DECnet PF_DLI
                    
19    PF_ECMA PF_GOSIP PF_HYLINK PF_IMPLINK PF_INET PF_LAT PF_MAX PF_NBS PF_NIT
                    
                
CUdpSocket.c git://pkgs.fedoraproject.org/gambas3 | C | 649 lines
                    
97	block = GB.Stream.Block(&SOCKET->stream, TRUE);
                    
98	USE_MSG_NOSIGNAL(ret = recvfrom(SOCKET->socket, (void*)buffer, sizeof(char), MSG_PEEK | MSG_NOSIGNAL, (struct sockaddr*)&THIS->addr, &host_len));
                    
99	GB.Stream.Block(&SOCKET->stream, block);
                    
141
                    
142	//USE_MSG_NOSIGNAL(numpoll=recvfrom(t_sock,POINTER(buf), sizeof(char), MSG_PEEK | MSG_NOSIGNAL, (struct sockaddr*)&t_test, &t_test_len));
                    
143	fill_buffer(THIS);
                    
514
                    
515	peeking = MSG_NOSIGNAL | MSG_PEEK;
                    
516
                    
                
sockex.c git://git.savannah.nongnu.org/liquidwar.git | C | 704 lines
                    
162		   */
                    
163		  if (recv (sock_copy, buffer, len, MSG_PEEK) == len)
                    
164		    {
                    
                
OverbyteIcsWinsock.pas http://dm-rc-server.googlecode.com/svn/trunk/ | Pascal | 736 lines
                    
154  {$EXTERNALSYM MSG_PEEK}
                    
155  MSG_PEEK                 = Winsock.MSG_PEEK;
                    
156  {$EXTERNALSYM MSG_OOB}
                    
                
pisock.py git://pkgs.fedoraproject.org/pilot-link | Python | 990 lines
                    
71PI_CMD_SYS = _pisock.PI_CMD_SYS
                    
72PI_MSG_PEEK = _pisock.PI_MSG_PEEK
                    
73PI_PF_DEV = _pisock.PI_PF_DEV
                    
                
pi-socket.h git://pkgs.fedoraproject.org/pilot-link | C Header | 580 lines
                    
75#define PI_CMD_SYS	0x03		/**< SYS protocol type (low-level, debugger connections) */
                    
76#define PI_MSG_PEEK	0x01		/**< Use this flag with pi_recv() to 'peek' at the incoming data (will not be removed from input buffer) */
                    
77/* deprecated (wasn't used)
                    
                
players.c git://pkgs.fedoraproject.org/esound | C | 678 lines
                    
232	if ( FD_ISSET(player->source_id, &rd_fds)
                    
233	     && (recv(player->source_id, &ch, 1, MSG_PEEK) < 1) ) {
                    
234	    /* Error or EOF */
                    
                
socket.h git://pkgs.fedoraproject.org/glibmm24 | C Header | 1081 lines
                    
130  SOCKET_MSG_OOB = GLIB_SYSDEF_MSG_OOB,
                    
131  SOCKET_MSG_PEEK = GLIB_SYSDEF_MSG_PEEK,
                    
132  SOCKET_MSG_DONTROUTE = GLIB_SYSDEF_MSG_DONTROUTE
                    
                
natPlainDatagramSocketImpl.cc git://pkgs.fedoraproject.org/compat-gcc-32 | C++ | 704 lines
                    
269  ssize_t retlen =
                    
270    ::recvfrom (fnum, (char *) NULL, 0, MSG_PEEK, (sockaddr*) &u,
                    
271      &addrlen);
                    
                
EddyLinux__Sockets.cpp https://netmflinux.svn.codeplex.com/svn | C++ | 1045 lines
                    
185        case SOCKET_READ_PEEK_OPTION:
                    
186            nativeFlag = MSG_PEEK;
                    
187            break;
                    
                
UTSecureSocket.cpp https://FilerFrog.svn.codeplex.com/svn | C++ | 2421 lines
                    
149		MoveMemory(buf, m_lpszDecodedData, dwBytesToCopy);
                    
150		if((flags & MSG_PEEK) == FALSE)
                    
151		{
                    
                
nic_nl.c git://pkgs.fedoraproject.org/iscsi-initiator-utils | C | 499 lines
                    
209	do {
                    
210		rc = nlpayload_read(fd, (void*)ev, sizeof(*ev), MSG_PEEK);
                    
211		if (rc < 0) {
                    
275	if ((rc = nl_read(nl_sock, nlm_ev,
                    
276		NLMSG_SPACE(sizeof(struct iscsi_uevent)), MSG_PEEK)) < 0) {
                    
277		LOG_ERR("can not read nlm_ev, error %d", rc);
                    
                
inet.c https://gitlab.com/nobody-mb/minecraft-classic-old-bot | C | 174 lines
                    
128		while (a != i-1){
                    
129			a = recv(stc, buffer+1, i-1, MSG_PEEK);
                    
130		}
                    
                
test_sockmap.c https://github.com/tytso/ext4.git | C | 2016 lines
                    
554{
                    
555	struct msghdr msg = {0}, msg_peek = {0};
                    
556	int err, i, flags = MSG_NOSIGNAL;
                    
563	if (peek_flag) {
                    
564		err = msg_alloc_iov(&msg_peek, iov_count, iov_length, data, tx);
                    
565		if (err)
                    
645			if (peek_flag) {
                    
646				flags |= MSG_PEEK;
                    
647				recvp = recvmsg(fd, &msg_peek, flags);
                    
                
socket.c https://gitlab.com/Orvillo/Tomato | C | 505 lines
                    
174{
                    
175	int fl = flags & (MSG_OOB|MSG_PEEK|MSG_DONTROUTE);
                    
176	
                    
186{
                    
187	int fl = flags & (MSG_OOB|MSG_PEEK|MSG_DONTROUTE);
                    
188	
                    
                
socket.h https://gitlab.com/BlueCabbage/NuttX | C Header | 234 lines
                    
102#define MSG_OOB        0x0001 /* Process out-of-band data.  */
                    
103#define MSG_PEEK       0x0002 /* Peek at incoming messages.  */
                    
104#define MSG_DONTROUTE  0x0004 /* Don't use local routing.  */
                    
                
libaudit.c https://gitlab.com/infraredbg/android_system_core-mt6589 | C | 488 lines
                    
112
                    
113    rc = audit_get_reply(fd, &rep, GET_REPLY_BLOCKING, MSG_PEEK);
                    
114    if (rc < 0) {
                    
                
sock.h https://gitlab.com/lely_industries/io | C Header | 697 lines
                    
52	//! Peeks at incoming data.
                    
53	IO_MSG_PEEK = 1 << 0,
                    
54	//! Requests out-of-band data.
                    
112 *               source address.
                    
113 * \param flags  the type of message reception (any combination of #IO_MSG_PEEK,
                    
114 *               #IO_MSG_OOB and #IO_MSG_WAITALL).
                    
                
pal_networking.h https://gitlab.com/0072016/0072016-corefx- | C Header | 448 lines
                    
197    PAL_MSG_OOB = 0x0001,       // SocketFlags.OutOfBand
                    
198    PAL_MSG_PEEK = 0x0002,      // SocketFlags.Peek
                    
199    PAL_MSG_DONTROUTE = 0x0004, // SocketFlags.DontRoute
                    
                
php_http.c http://php52-backports.googlecode.com/svn/trunk/ | C | 1380 lines
                    
49		if (php_pollfd_for_ms(socket, PHP_POLLREADABLE, 0) > 0) {
                    
50			if (0 == recv(socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EAGAIN) {
                    
51				return FALSE;
                    
                
xp_socket.c http://php52-backports.googlecode.com/svn/trunk/ | C | 834 lines
                    
37
                    
38#ifndef MSG_PEEK
                    
39# define MSG_PEEK 0
                    
291				} else if (php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) {
                    
292					if (0 >= recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) {
                    
293						alive = 0;
                    
367					if ((xparam->inputs.flags & STREAM_PEEK) == STREAM_PEEK) {
                    
368						flags |= MSG_PEEK;
                    
369					}
                    
                
lasync.c http://luasync.googlecode.com/svn/trunk/ | C | 793 lines
                    
643 for (i = 0; i < 1; i++) {
                    
644     ret = sendmsg(fd, &msg.msg, i == 0 ? MSG_PEEK : 0);
                    
645
                    
                
constants.h http://android-ruby.googlecode.com/svn/trunk/ | C Header | 1080 lines
                    
330#ifdef MSG_PEEK
                    
331    sock_define_const("MSG_PEEK", MSG_PEEK);
                    
332#endif
                    
                
client.cpp https://github.com/drtrev/curses.git | C++ | 321 lines
                    
239
                    
240    numRecv = recv(sockfd, data, recvSize, MSG_PEEK);
                    
241
                    
                
natPlainDatagramSocketImplWin32.cc https://github.com/atgreen/moxiedev.git | C++ | 706 lines
                    
156  ssize_t retlen =
                    
157    ::recvfrom (native_fd, (char *) NULL, 0, MSG_PEEK, (sockaddr*) &u,
                    
158      &addrlen);
                    
211  retlen =
                    
212    ::recvfrom (native_fd, (char *) dbytes, maxlen, MSG_PEEK, (sockaddr*) &u,
                    
213      &addrlen);
                    
                
ipv4-raw-test.cc https://gitlab.com/pmaddi/cs433 | C++ | 326 lines
                    
110  availableData = socket->GetRxAvailable ();
                    
111  m_receivedPacket = socket->Recv (2, MSG_PEEK);
                    
112  NS_ASSERT (m_receivedPacket->GetSize () == 2);
                    
120  availableData = socket->GetRxAvailable ();
                    
121  m_receivedPacket2 = socket->Recv (2, MSG_PEEK);
                    
122  NS_ASSERT (m_receivedPacket2->GetSize () == 2);
                    
                
MSocketSupport.bas http://xbot2003.googlecode.com/svn/trunk/ | Basic | 1175 lines
                    
37Public Const MSG_OOB = &H1         '/* process out-of-band data */
                    
38Public Const MSG_PEEK = &H2        '/* peek at incoming message */
                    
39Public Const MSG_DONTROUTE = &H4   '/* send without using routing tables */
                    
                
DtlsTransport.cxx http://openqwaq.googlecode.com/svn/trunk/ | C++ | 702 lines
                    
127   // .dlb. can we determine the size of the buffer before we allocate?
                    
128   // something about MSG_PEEK|MSG_TRUNC in Stevens..
                    
129   // .dlb. RFC3261 18.1.1 MUST accept 65K datagrams. would have to attempt to
                    
                
UdpTransport.cxx http://openqwaq.googlecode.com/svn/trunk/ | C++ | 549 lines
                    
150      // .dlb. can we determine the size of the buffer before we allocate?
                    
151      // something about MSG_PEEK|MSG_TRUNC in Stevens..
                    
152      // .dlb. RFC3261 18.1.1 MUST accept 65K datagrams. would have to attempt to
                    
                
poll.c git://git.savannah.gnu.org/gsasl.git | C | 608 lines
                    
65
                    
66/* BeOS does not have MSG_PEEK.  */
                    
67#ifndef MSG_PEEK
                    
67#ifndef MSG_PEEK
                    
68# define MSG_PEEK 0
                    
69#endif
                    
241      WSASetLastError (0);
                    
242      r = recv (h, data, sizeof (data), MSG_PEEK);
                    
243      error = WSAGetLastError ();
                    
279# if defined __MACH__ && defined __APPLE__
                    
280      /* There is a bug in Mac OS X that causes it to ignore MSG_PEEK
                    
281         for some kinds of descriptors.  Detect if this descriptor is a
                    
283         0-byte recv, and use ioctl(2) to detect POLLHUP.  */
                    
284      r = recv (fd, NULL, 0, MSG_PEEK);
                    
285      socket_errno = (r < 0) ? errno : 0;
                    
                
socket_test.py git://github.com/IronLanguages/main.git | Python | 648 lines
                    
136                 "MSG_OOB" : 1,
                    
137                 "MSG_PEEK" : 2,
                    
138                 "MSG_TRUNC" : 32,
                    
                
gnutls_buffers.c git://github.com/xbmc/xbmc.git | C | 1112 lines
                    
297/* This function is only used with berkeley style sockets.
                    
298 * Clears the peeked data (read with MSG_PEEK).
                    
299 */
                    
315
                    
316  /* this was already read by using MSG_PEEK - so it shouldn't fail */
                    
317  sum = 0;
                    
346
                    
347/* This function is like recv(with MSG_PEEK). But it does not return -1 on error.
                    
348 * It does return MHD_gnutls_errno instead.
                    
469  /* This is a hack placed in order for select to work. Just leave recvlowat data,
                    
470   * into the kernel buffer (using a read with MSG_PEEK), thus making
                    
471   * select think, that the socket is ready for reading.
                    
471   * select think, that the socket is ready for reading.
                    
472   * MSG_PEEK is only used with berkeley style sockets.
                    
473   */
                    
                
connection.c https://github.com/q3k/uhub.git | C | 328 lines
                    
212{
                    
213	int ret = net_recv(con->sd, buf, len, MSG_PEEK);
                    
214	if (ret == -1)
                    
                
lwt_unix_unix.c git://github.com/aryx/fork-ocsigen.git | C | 3737 lines
                    
134static int msg_flag_table[] = {
                    
135  MSG_OOB, MSG_DONTROUTE, MSG_PEEK
                    
136};
                    
                
 

Source

Language