Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

socket set block function syntax tag tutorial 2013 Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Php socket set block () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 4 >= 4.2.0, PHP 5)

socket_set_block --  Sets blocking mode on a socket resource

Syntax

bool socket_set_block ( resource socket )

The socket_set_block() function removes the O_NONBLOCK flag on the socket specified by the socket parameter.

Example 1. socket_set_block() example

<?php

$port
= 9090;
if (!
$socket = socket_create_listen($port)) {
    echo
socket_strerror(socket_last_error());
}

if (!
socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1)) {
    echo
socket_strerror(socket_last_error());
}

if (!
socket_set_nonblock($socket)) { // $socket is now nonblocking
    
echo socket_strerror(socket_last_error());
}

if (!
socket_set_block($socket)) {     // $socket is now blocking
    
echo socket_strerror(socket_last_error());
}

?>

Returns TRUE on success or FALSE on failure.

See also socket_set_nonblock() and socket_set_option()

Php socket set block Function syntax tag

socket set block php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php socket set block syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online