100+ results for 'MSG_PEEK'

Not the results you expected?

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

socket_types.hpp (https://github.com/ratboy2499/evemu_incursion.git) C++ Header · 176 lines

111 const int shutdown_both = SD_BOTH;

112 const int message_peek = MSG_PEEK;

113 const int message_out_of_band = MSG_OOB;

155 const int shutdown_both = SHUT_RDWR;

156 const int message_peek = MSG_PEEK;

157 const int message_out_of_band = MSG_OOB;

mod_jaxer_message.h (https://github.com/absynce/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

application_manager.rb (https://gitlab.com/gitnyasha/zimcreative) Ruby · 140 lines

124 IO.select([child])

125 break if child.recv(1, Socket::MSG_PEEK).empty?

126 sleep 0.01

recvfrom_spec.rb (https://github.com/rklemme/ruby.git) Ruby · 98 lines

34 it "uses different message options" do

35 @client.send("foobar", Socket::MSG_PEEK)

36 sock = @server.accept

37 peek_data = sock.recvfrom(6, Socket::MSG_PEEK) # Does not retrieve the message

38 real_data = sock.recvfrom(6)

socket.d (https://github.com/SiegeLord/Tango-D2.git) D · 498 lines

95 MSG_OOB

96 MSG_PEEK

97 MSG_TRUNC

os_socket.h (https://bitbucket.org/oregon/oregoncore/) C Header · 306 lines ✨ Summary

This C header file provides a set of socket-related functions and constants for use in C programs. It defines various socket options, error codes, and protocol families (e.g., IPv4, IPv6) that can be used to create and manage sockets. The code also includes function prototypes for receiving and sending data over sockets with timed waits, allowing for more precise control over timeouts.

152

153 #if !defined (MSG_PEEK)

154 # define MSG_PEEK 0x2

155 #endif /* MSG_PEEK */

156

u_network.c (https://bitbucket.org/peixuan/chromium_r197479_base.git) C · 188 lines

90 #if defined(PIPE_HAVE_SOCKETS)

91 return recv(s, data, size, MSG_PEEK);

92 #else

socket.php (https://github.com/philbrookes/Game.git) PHP · 99 lines

81 public function isAlive(){

82 $res = @socket_recv($this->sockHandle, $data, 1024, MSG_PEEK);

83 $result = socket_last_error($this->sockHandle);

ngx_http_ajp_msg.c (https://github.com/yaoweibin/nginx_ajp_module.git) C · 482 lines

244 ngx_int_t

245 ajp_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 }

265 ngx_int_t

266 ajp_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 */

155 static inline void nl_socket_enable_msg_peek(struct nl_sock *sk)

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.

auth-pwd.c (https://github.com/Shirk/zsrelay.git) C · 259 lines

47

48 r = timerd_read(s, buf, sizeof(buf), TIMEOUTSEC, MSG_PEEK);

49 if ( r < 2 )

70 /* get passwd */

71 r = timerd_read(s, buf, sizeof(buf), TIMEOUTSEC, MSG_PEEK);

72 if ( r < 1 )

vchi.h (https://github.com/ThomasHabets/linux.git) C Header · 159 lines

108 // will return the same message.

109 extern int32_t vchi_msg_peek(struct vchi_service_handle *handle,

110 void **data,

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)

constdefs.h (https://github.com/GunioRobot/rhodes.git) C Header · 1788 lines

431 #endif

432 #if !defined(MSG_PEEK)

433 # if defined(HAVE_CONST_MSG_PEEK)

434 # define MSG_PEEK MSG_PEEK

435 # endif

tcpstream.cpp (https://github.com/azboul/multitheftauto.git) C++ · 114 lines

49 {

50 len = recv(m_handle, (void *)&tmp, sizeof(char), MSG_TRUNC | MSG_PEEK);

51 if (len < 0)

test1.c (https://gitlab.com/o1s2/selflrrn) C · 208 lines

34

35 #ifndef MSG_PEEK

36 printf("+ MSG_PEEK not defined\n");

socket.d (https://github.com/soywiz/pspemu.git) D · 670 lines

101 MSG_OOB

102 MSG_PEEK

103 MSG_TRUNC

252 MSG_OOB = 0x01,

253 MSG_PEEK = 0x02,

254 MSG_TRUNC = 0x20,

402 MSG_OOB = 0x1,

403 MSG_PEEK = 0x2,

404 MSG_TRUNC = 0x10,

574 MSG_OOB = 0x1,

575 MSG_PEEK = 0x2,

576 MSG_TRUNC = 0x10,

socket_util.c (https://bitbucket.org/freebsd/freebsd-base.git) C · 75 lines

56 * without consuming bytes from the socket buffer. */

57 rv = apr_socket_recvfrom(&unused, sock, MSG_PEEK, &buf, &len);

58 if (rv == APR_EOF) {

socket.scm (https://code.google.com/p/sagittarius-scheme/) Scheme · 92 lines

62 MSG_OOB

63 MSG_PEEK

64 MSG_DONTROUTE

LSOCK.cpp (https://bitbucket.org/oregon/oregoncore/) C++ · 184 lines ✨ Summary

This C++ code implements a Unix domain socket (UDS) class, ACE_LSOCK, which provides functions for sending and receiving file descriptors over a UDS connection. The send_handle function sends an open file descriptor to the peer, while the recv_handle function receives an open file descriptor from the peer. The code uses various operating system APIs, such as sendmsg and recvmsg, to implement these functions.

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;

network.c (https://bitbucket.org/amontero/tinyproxy.git) C · 238 lines

164 for (;;) {

165 ret = recv(fd, buffer, SEGMENT_LEN, MSG_PEEK);

166 if (ret <= 0)

socket.d (https://github.com/fawzi/oldTango.git) D · 113 lines

101 MSG_OOB = 0x1,

102 MSG_PEEK = 0x2,

103 MSG_TRUNC = 0x10,

sendrecv.c (https://github.com/colinbenner/ocaml-llvm.git) C · 141 lines

23 static int msg_flag_table[] = {

24 MSG_OOB, MSG_DONTROUTE, MSG_PEEK

25 };

linux_socket.h (https://github.com/okuoku/freebsd-head.git) C Header · 119 lines

36 #define LINUX_MSG_OOB 0x01

37 #define LINUX_MSG_PEEK 0x02

38 #define LINUX_MSG_DONTROUTE 0x04

sock.pyx (https://gitlab.com/lely_industries/io) Cython · 469 lines

12

13 IO_MSG_PEEK = _IO_MSG_PEEK

14 IO_MSG_OOB = _IO_MSG_OOB

udp_connection.cpp (https://github.com/nanomo/network-traffic-generator.git) C++ · 207 lines

104 rflag=PROTOCOL_NONE;

105 if (flags&PROTOCOL_PEEK) rflag|=MSG_PEEK;

106 #if defined(__WIN32__)

socket.d (https://github.com/mirrors/gcc.git) D · 1894 lines

128 MSG_OOB

129 MSG_PEEK

130 MSG_TRUNC

525 MSG_OOB = 0x01,

526 MSG_PEEK = 0x02,

527 MSG_TRUNC = 0x20,

668 MSG_OOB = 0x1,

669 MSG_PEEK = 0x2,

670 MSG_TRUNC = 0x10,

827 MSG_OOB = 0x1,

828 MSG_PEEK = 0x2,

829 MSG_TRUNC = 0x10,

999 MSG_OOB = 0x0001, /* process out-of-band data */

1000 MSG_PEEK = 0x0002, /* peek at incoming message */

_-select.c (https://github.com/MewX/Psiphon3-for-Linux.git) C · 297 lines

276 if( isWindowsCE() ){

277 /* without MSG_PEEK, to set PS_PRI to show disconn. */

278 ev2 |= PS_PRI;

287 int rcc;

288 rcc = recv(fd,buf,1,MSG_PEEK|MSG_OOB);

289 syslog_DEBUG("---- PollInOuts(%d)PRI OOB=%d\n",fd,rcc);

listener_filter_fuzzer.cc (https://github.com/envoyproxy/envoy.git) C++ · 124 lines

54 [&data](os_fd_t, void* buffer, size_t length, int flags) -> Api::SysCallSizeResult {

55 return data.read(buffer, length, flags == MSG_PEEK);

56 }));

loopudp.c (https://gitlab.com/peter__barnes/work) C · 210 lines

159 } else if (connectudp) {

160 /* msgpeek = 0 or MSG_PEEK */

161 flags = msgpeek;

IO.pm (https://github.com/dwimperl/perl-5.12.3.0.git) Perl · 261 lines

26 for(

27 $peer = recv($_[0],$buf,$n,MSG_PEEK);

28 defined $peer;

29 $peer = recv($_[0],$buf,$n<<=1,MSG_PEEK)

30 ) {

78 goto error

79 unless defined($peer = recv($_[0],$buf,$len,MSG_PEEK));

80

91

92 if ($_[2] & MSG_PEEK) {

93 $_[1] = substr($buf,0,$len);

common.cpp (https://github.com/silviu/quill.git) C++ · 236 lines

76 while(!found) {

77 int rc = recv(fd, buf, BUF_SIZE, MSG_PEEK);

78 if (rc == -1) {

socket.h (https://github.com/managarm/mlibc.git) C Header · 283 lines

261 #define MSG_OOB 0x0001

262 #define MSG_PEEK 0x0002

263 #define MSG_DONTROUTE 0x0004

sslinux.pas (http://transmisson-remote-gui.googlecode.com/svn/trunk/) Pascal · 1315 lines ✨ Summary

This is a set of functions for working with IPv6 addresses and networks in the Delphi programming language. It includes functions for converting between different representations of IPv6 addresses, such as text and binary, as well as functions for checking whether an address is within a given network or subnet.

366 MSG_OOB = $01; // Process out-of-band data.

367 MSG_PEEK = $02; // Peek at incoming messages.

368

SocketMessage.java (https://github.com/jnr/jnr-constants.git) Java · 50 lines

6 // MSG_DONTWAIT not defined

7 MSG_PEEK(0x2L),

8 MSG_DONTROUTE(0x4L),

38 map.put(MSG_OOB, "MSG_OOB");

39 map.put(MSG_PEEK, "MSG_PEEK");

40 map.put(MSG_DONTROUTE, "MSG_DONTROUTE");

blackadder.cpp (https://github.com/tsilochr/blackadder.git) C++ · 278 lines

246 char *buf;

247 total_buf_size = recv(sock_fd, fake_buf, 1, MSG_PEEK | MSG_TRUNC | MSG_WAITALL);

248 if (total_buf_size > 0) {

msg.c (https://quake.svn.sourceforge.net/svnroot/quake) C · 382 lines

372 int

373 MSG_PeekByte (msg_t *msg)

374 {

posix.h (https://github.com/phoenix-rtos/phoenix-rtos-kernel.git) C Header · 182 lines

128

129 #define MSG_PEEK 0x01

130 #define MSG_WAITALL 0x02

Link.cpp (https://github.com/DOCGroup/ATCD.git) C++ · 330 lines

205 ACE_Time_Value t (params_.tick ());

206 ssize_t r = rsock_.recv (data, 4, addr, MSG_PEEK, &t);

207

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

socket.h (https://bitbucket.org/devzero2000/openvswitch.git) C Header · 133 lines

85 MSG_NOSIGNAL,

86 MSG_PEEK,

87 MSG_TRUNC,

clients.c (https://github.com/zcoder/netio.git) C · 410 lines

275

276 ssize_t recvsize = recv( set->fd, recvbuff, p_recvbuff, MSG_PEEK );

277 if ( recvsize == -1 )

socket_io.cpp (https://github.com/suhailsherif/MySQL-5.1-.git) C++ · 332 lines

85 int t;

86 while((t = recv(socket, ptr, len, MSG_PEEK)) == -1 && errno == EINTR);

87

SocketInProvider.h (https://github.com/nterman/nbites.git) C Header · 157 lines

138

139 if (recv(file_descriptor, buffer, size, MSG_PEEK) < 0) {

140 throw aio_read_exception(aio_read_exception::READ, errno);

send_spec.rb (https://github.com/nurse/ruby.git) Ruby · 220 lines

46 client = @server.accept

47 peek_data = client.recv(6, Socket::MSG_PEEK)

48 data = client.recv(6)

54

55 @socket.send('helloU', Socket::MSG_PEEK | Socket::MSG_OOB).should == 6

56 @socket.shutdown # indicate, that we are done sending

datagram.c (https://github.com/tiwai/sound.git) C · 199 lines

121

122 if (flags & ~(MSG_PEEK|MSG_TRUNC|MSG_DONTWAIT|MSG_NOSIGNAL|

123 MSG_CMSG_COMPAT))

heartbleed_example.c (https://github.com/atxsinn3r/VulnCases.git) C · 159 lines

108 // recv() will complete when the input ends with \r\d

109 bytesRead = recv(clientSocket, recvBuffer, recvBufferLen, MSG_PEEK);

110 if (bytesRead > 0) {

protocol.c (https://bitbucket.org/JuantAldea/lut-2012-network-programming.git) C · 263 lines

38 int recv_bytes;

39 while ((recv_bytes = recv(socket, buffer, MAX_MSG_SIZE, MSG_PEEK)) > 0){

40 if (strchr(buffer, '\r') != NULL && strchr(buffer, '\n') != NULL){

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

kernel_footprint.c (https://github.com/batt/StratoSpera.git) C · 96 lines

81 msg_put(&in_port, &msg);

82 msg_peek(&in_port);

83 Msg *msg_re = msg_get(&in_port);

net.c (https://github.com/ncsurobotics/svr.git) C · 146 lines

108 minus the header data */

109 n = SVR_Net_recv(socket, &message_length, sizeof(uint16_t), MSG_PEEK);

110

poll.cc (https://bitbucket.org/pizzafactory/binutils.git) C++ · 158 lines

109 /* This should be sufficient for sockets, too. Using

110 MSG_PEEK, as before, can be considered dangerous at

111 best. Quote from W. Richard Stevens: "The presence

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 }

send_spec.rb (https://github.com/Catweazle/ironruby.git) Ruby · 69 lines

38 client = @server.accept

39 peek_data = client.recv(6, Socket::MSG_PEEK)

40 data = client.recv(6)

45

46 @socket.send('helloU', Socket::MSG_PEEK | Socket::MSG_OOB).should == 6

47

socket.h (https://github.com/shattered/linux-m68k.git) C Header · 147 lines

91 #define MSG_OOB 1

92 #define MSG_PEEK 2

93 #define MSG_DONTROUTE 4

receive-data-from-socket.md (https://github.com/huy/linux_kernel_study.git) Markdown · 147 lines

101

102 if (flags & MSG_PEEK) {

103 spin_lock_irqsave(&sk->sk_receive_queue.lock,

getpeereid.c (https://bitbucket.org/killerpenguinassassins/open_distrib_devel.git) C · 222 lines

138 * AIX returns a bogus file descriptor if recvmsg() is

139 * called with MSG_PEEK (is this a bug?). Hence we need

140 * to receive the Abandon PDU.

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)

SocketSerialized.cpp (https://github.com/Krozark/cpp-Socket.git) C++ · 373 lines

289 {

290 res = init_receive(&size,MSG_PEEK);

291 if(res > 0 and size>0)

328 {

329 res = init_receive(&size,MSG_PEEK);

330 if(res > 0 and size>0)

glibconfig.h (https://github.com/SLIBIO/SLib.git) C Header · 212 lines

206 #define GLIB_SYSDEF_MSG_OOB 1

207 #define GLIB_SYSDEF_MSG_PEEK 2

208 #define GLIB_SYSDEF_MSG_DONTROUTE 4

websocketproxy.py (https://github.com/bcwaldon/nova.git) Python · 95 lines

74 while True:

75 data = tsock.recv(4096, socket.MSG_PEEK)

76 if data.find("\r\n\r\n") != -1:

SSL_SOCK_Stream.inl (https://gitlab.com/mohsencs/SunWellCore) C++ Header · 364 lines

122 {

123 if (ACE_BIT_ENABLED (flags, MSG_PEEK))

124 {

socket.h (https://gitlab.com/abidin24/sortix) C Header · 189 lines

137 #define MSG_NOSIGNAL (1<<4)

138 #define MSG_PEEK (1<<5)

139 #define MSG_TRUNC (1<<6)

socket.d (https://github.com/wolfwood/djehuty.git) D · 300 lines

259 {

260 //ulong total = recv(sockVars.m_skt, null, 0, MSG_PEEK);

261

socket.c (https://github.com/scala-native/scala-native.git) C · 203 lines

73

74 int scalanative_MSG_PEEK() { return MSG_PEEK; }

75

web.py (https://github.com/paraboul/noVNC.git) Python · 53 lines

31 newsocket, from_addr = bindsocket.accept()

32 peek = newsocket.recv(1024, socket.MSG_PEEK)

33 if peek.startswith("\x16"):

socket_non_stream.cc (https://github.com/google/gvisor.git) C++ · 337 lines

138 ASSERT_THAT(RetryEINTR(recv)(sockets->second_fd(), received_data,

139 sizeof(received_data), MSG_PEEK),

140 SyscallSucceedsWithValue(sizeof(sent_data1)));

256

257 // This test tests reading from a socket with MSG_TRUNC | MSG_PEEK and a zero

258 // length receive buffer. The user should be able to get the message length

281 ASSERT_THAT(RetryEINTR(recvmsg)(sockets->second_fd(), &peek_msg,

282 MSG_TRUNC | MSG_PEEK),

283 SyscallSucceedsWithValue(sizeof(sent_data)));

310

311 // This test tests reading from a socket with MSG_TRUNC | MSG_PEEK and a zero

312 // length receive buffer and MSG_DONTWAIT. The user should be able to get an

331 ASSERT_THAT(RetryEINTR(recvmsg)(sockets->second_fd(), &peek_msg,

332 MSG_TRUNC | MSG_PEEK | MSG_DONTWAIT),

333 SyscallFailsWithErrno(EAGAIN));

test_websocketproxy.py (https://github.com/SiggyBar/emscripten.git) Python · 136 lines

46 res = self._data[0:amt]

47 if not (flags & socket.MSG_PEEK):

48 self._data = self._data[amt:]

sockets.constants.html (https://github.com/cue-taro/emacs-setting-files.git) HTML · 2766 lines

175 <span class="term">

176 <b><tt>MSG_PEEK</tt></b>

177 (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)

SOCKET.py (https://bitbucket.org/__wp__/mb-linux-msli.git) Python · 145 lines

120 MSG_OOB = 0x1

121 MSG_PEEK = 0x2

122 MSG_DONTROUTE = 0x4

ENServer.cpp (https://github.com/brucetsao/86Duino.git) C++ · 227 lines

187

188 if (recv(Clients[j]._sock, &val, 1, MSG_PEEK) <= 0)

189 Clients[j].stop();

udp.cpp (https://github.com/MaxBelkov/visualsyslog.git) C++ · 633 lines

363

364 bytes = recv(handle, (char *)data, size, bPeek ? MSG_PEEK : 0);

365 if( bytes == SOCKET_ERROR )

449 int fromlen = sizeof(struct sockaddr);

450 bytes = recvfrom(handle, (char *)data, size, bPeek ? MSG_PEEK : 0, p, &fromlen);

451 if( bytes==SOCKET_ERROR )

socket_wrapper.cpp (https://gitlab.com/envieidoc/advancedtomato2) C++ · 208 lines

165 byte b;

166 return receive(&b, 1, MSG_PEEK) != static_cast<uint>(-1);

167 }

netwrap_socket.c (https://github.com/OpenFastPath/ofp.git) C · 676 lines

605 ofp_flags |= OFP_MSG_OOB;

606 if (flags & MSG_PEEK)

607 ofp_flags |= OFP_MSG_PEEK;

constants_spec.rb (https://github.com/gilmation/rubyspec.git) Ruby · 64 lines

27 it "defines send/receive options" do

28 consts = ["MSG_DONTROUTE", "MSG_OOB", "MSG_PEEK"]

29 consts.each do |c|

hev-socks5-session-udp.c (https://github.com/heiher/hev-socks5-tproxy.git) C · 302 lines

93

94 res = recv (fd, buf, 1, MSG_PEEK);

95 if (res <= 0) {

checkSock.cpp (https://github.com/ALTIBASE/altibase.git) C++ · 53 lines

35

36 #if defined(MSG_PEEK)

37 CHECK(MSG_PEEK != 0);

conn.go (https://github.com/snapcore/snapd.git) Go · 175 lines

65 // Just read how many bytes are available in the socket

66 if n, _, err = syscall.Recvfrom(c.Fd, buf, syscall.MSG_PEEK); err != nil {

67 return

mod.rs (https://github.com/chromium/chromium.git) Rust · 103 lines

79 pub const MSG_OOB: ::c_int = 0x04;

80 pub const MSG_PEEK: ::c_int = 0x01;

81 pub const MSG_DONTWAIT: ::c_int = 0x08;

Makefile.PL (https://bitbucket.org/thelearninglabs/uclinux-distro-tll-public.git) Perl · 68 lines

56 "#endif\n"]}

57 foreach qw (MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS);

58

socket.h (https://github.com/bigboss-ps3dev/PSL1GHT.git) C Header · 121 lines

69 #define MSG_OOB 0x0001

70 #define MSG_PEEK 0x0002

71 #define MSG_DONTROUTE 0x0004

TCPSocket.cpp (https://github.com/necrophcodr/Passion.git) C++ · 146 lines

140 char temp;

141 return recv( m_socket, &temp, 1, MSG_PEEK ) == 1;

142 } else {

vp_com_socket_utils.c (https://github.com/zhengwy888/ARDrone-SDK_MF.git) C · 223 lines

161 /* Query packet size */

162 available = recvfrom(s, (char*)local_buffer,0, MSG_PEEK|MSG_TRUNC, (struct sockaddr*)&from, &fromlen);

163

peek.c (https://github.com/rillian/firefox.git) C · 360 lines

6 /*

7 * A test case for the PR_MSG_PEEK flag of PR_Recv().

8 *

55 nbytes = PR_Recv(sock, buf, recv_amount[i],

56 PR_MSG_PEEK, PR_INTERVAL_NO_TIMEOUT);

57 if (-1 == nbytes) {

75 nbytes = PR_Recv(sock, buf, recv_amount[i],

76 PR_MSG_PEEK, PR_INTERVAL_NO_TIMEOUT);

77 if (-1 == nbytes) {

213 while ((nbytes = PR_Recv(sock, buf, recv_amount[i],

214 PR_MSG_PEEK, PR_INTERVAL_NO_TIMEOUT)) == -1) {

215 if (PR_GetError() != PR_WOULD_BLOCK_ERROR) {

245 nbytes = PR_Recv(sock, buf, recv_amount[i],

246 PR_MSG_PEEK, PR_INTERVAL_NO_TIMEOUT);

247 if (-1 == nbytes) {

WinThread_Client.cpp (http://sandblastplanning.googlecode.com/svn/trunk/) C++ · 90 lines

72 {

73 CliSock.Receive(&RecvBuff,30,MSG_PEEK);

74 }

sockets-constants.ads (https://github.com/samueltardieu/adasockets.git) Ada · 84 lines

54 O_Nonblock : constant := 16#20000#;

55 Msg_Peek : constant := 16#0002#;

56 Fionbio : constant := -2147195266;

recvfrom_spec.rb (https://github.com/zenspider/ruby.git) Ruby · 123 lines

100

101 @server.recvfrom(2, Socket::MSG_PEEK)[0].should == 'he'

102

message_flags.hpp (git://github.com/dietmarkuehl/kuhllib.git) C++ Header · 74 lines

36 enum class message_flags: unsigned int {

37 peek = MSG_PEEK,

38 out_of_band = MSG_OOB,

routineutil.cpp (https://github.com/tencent-wechat/phxsql.git) C++ · 157 lines

147 if (pf[0].revents & POLLIN) {

148 return recv(source_fd, buf, buf_size, MSG_PEEK);

149 } else if (pf[0].revents & POLLHUP) {

socket.scala (https://github.com/scala-native/scala-native.git) Scala · 238 lines

113

114 @name("scalanative_MSG_PEEK")

115 def MSG_PEEK: CInt = extern

http.c (https://github.com/itanko/last.fm-lib.git) C · 207 lines

110 for(;;) {

111 recvd = recv(sock, buff, 1024, MSG_PEEK);

112 if((recvd != 0 ) & (recvd != -1)) break;

cups-2.0.2-poll-CPU-loop-STR-4605.patch (https://gitlab.com/rindeal/gentoo-cvs-history-archive) Patch · 48 lines

21

22 + if (!httpGetReady(con->http) && recv(httpGetFd(con->http), buf, 1, MSG_PEEK) < 1)

23 + {

socket.h (https://github.com/freemint/freemint.git) C Header · 112 lines

63 # define MSG_OOB 1

64 # define MSG_PEEK 2

65 # define MSG_DONTROUTE 4

ecore_audio_pulse_ml.c (https://github.com/Enlightenment/efl.git) C · 355 lines

58 /* Check for HUP and report */

59 if (recv(fd, buf, 64, MSG_PEEK))

60 {

socket.h (https://repo.or.cz/AquilaOS.git) C Header · 85 lines

62 #define MSG_NOSIGNAL 0x0010

63 #define MSG_PEEK 0x0020

64 #define MSG_TRUNC 0x0040

ngx_http_php_keepalive.c (https://github.com/rryqszq4/ngx_php7.git) C · 219 lines

186

187 n = recv(c->fd, buf, 1, MSG_PEEK);

188

send_spec.rb (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Ruby · 82 lines

44 client = @server.accept

45 peek_data = client.recv(6, Socket::MSG_PEEK)

46 data = client.recv(6)

52

53 @socket.send('helloU', Socket::MSG_PEEK | Socket::MSG_OOB).should == 6

54 @socket.shutdown # indicate, that we are done sending

dacqcomm.h (https://bitbucket.org/palday/fieldtrip.git) C Header · 72 lines

33 #define DACQ_DRAIN_INPUT 0

34 #define DACQ_KEEP_INPUT MSG_PEEK

35

socket.h (https://github.com/wanggx/Linux1.0.git) C Header · 96 lines

48 /* ½ö½öÊÇÊý¾ÝÔ¤ÏȶÁÈ¡ºÍ¼ì²é£¬ÀýÈç¶ÁÈ¡Ò»¸öskb£¬µ«ÊDz»½«skb´Ó¶ÓÁÐÖÐɾ³ý */

49 #define MSG_PEEK 2

50

getpeereid.c (https://github.com/ReOpen/ReOpenLDAP.git) C · 213 lines

129 * AIX returns a bogus file descriptor if recvmsg() is

130 * called with MSG_PEEK (is this a bug?). Hence we need

131 * to receive the Abandon PDU.

test_sctp_recvmsg.c (https://bitbucket.org/brucec/sctpdrv) C · 202 lines

105

106 DEFINE_APITEST(sctp_recvmsg, msg_peek_in)

107 {

119 }

120 flags = MSG_PEEK;

121 n = sctp_recvmsg(fd[1], buffer, 1, NULL, 0, NULL, &flags);

recvmsg_test.cc (https://github.com/NuxiNL/cloudlibc.git) C++ · 88 lines

63 };

64 ASSERT_EQ(4, recvmsg(fds[1], &msg, MSG_PEEK));

65 buf[4] = '\0';

__init__.py (https://github.com/dhain/greennet.git) Python · 360 lines

183 9

184 >>> recv(s2, 4, socket.MSG_PEEK)

185 'some'

299 while True:

300 data = _recv(sock, bufsize, socket.MSG_PEEK, timeout=timeout)

301 if not data: