I created stream socket, tries to connect to port 7 on the remote machine.
After doing the non blocking connect call I did select with time out value is 3 secs. I am always getting timed out though I am writing prior to select.
code:
My doubt is write on non blocking socket will happen or write fails and select will timeout. What do I have to do to connection successful
Moderator's Comments:
After more than 40 posts you should know how and when to apply code tags
---------- Post updated 09-05-10 at 01:11 PM ---------- Previous update was 09-04-10 at 11:56 PM ----------
I found wrong in my code. I should move my write to the else part and I should set read flags as NULL and write flags as my socket.
---------- Post updated at 01:15 PM ---------- Previous update was at 01:11 PM ----------
Hi everybody !
We have all flavors of Unix / Linux and we want to restrict ftp users to telnet our servers.
We can't disable telnet because we have other users using it.
:confused: Are there any thing that could be done to solve this thing ???
Best regards,
Julio Moreira (11 Replies)
I've got a legit DHCP server on my network. I've got a 3550 as my VTP server providing 4 vlans to 4 2950 switches. If somebody were to plug into one of those vlans with a DHCP server configured then it would throw off my whole network. How could i block the DHCP server that could plug into the... (2 Replies)
Hello,
When using a non-blocking connect, is it _guaranteed_ that connection completion can be detected by selecting for writeability?
I have encountered situations where the socket has returned both readable and writeable at the same time - having trawled the net, I have seen some old posts... (1 Reply)
Hi Folks
I have been debugging a script that is called every thirty seconds. Basically it is doing a ps, well two actually, one to file (read by the getline below) and the other into a pipe. The one into the pipe is: -
V_SYSVPS=/usr/sysv/bin/ps
$V_SYSVPS -p$PIDLIST -o$PSARGS... (0 Replies)
We have a production server at a client site running AIX. And recently when users are trying to connect to it via telnet, it prompts "No more multiple IP addresses to connect".
Can I know what does this error mean? and how to rectify this?
Thanks. (2 Replies)
will there be any unexpected results on looping connect call for a non blocking socket to determine the connection based on error code. I am getting connection unsuccessful intermittently and so wondering whether is the timeout 500 millisec not sufficient or looping connect cause any unexpected.
... (7 Replies)
It appears i cant connect linux VPS server via SSH or i cant SCP any file to it and i cant wget any file TO it (from inside it) while CSF (Config Server Firewall, LFD is running. Just after isntall in default configuration and after changing TESTING mode to LIVE mode.
Trying to wget & install... (1 Reply)
among the below socket programming api's, please let me know which are blocking and non-blocking.
socket
accept
bind
listen
write
read
close (2 Replies)
Greetings Experts,
I am working for a bank client and have a question on connect-direct and SFTP.
We are using Linux RedHat servers. We use connect-direct to transfer (NDM) files from one server to another server. At times, we manually transfer the files using SFTP from one server to another... (2 Replies)
Discussion started by: chill3chee
2 Replies
LEARN ABOUT PHP
socket_set_block
SOCKET_SET_BLOCK(3) 1 SOCKET_SET_BLOCK(3)socket_set_block - Sets blocking mode on a socket resourceSYNOPSIS
bool socket_set_block (resource $socket)
DESCRIPTION
The socket_set_block(3) function removes the O_NONBLOCK flag on the socket specified by the $socket parameter.
When an operation (e.g. receive, send, connect, accept, ...) is performed on a blocking socket, the script will pause its execution until
it receives a signal or it can perform the operation.
PARAMETERS
o $socket
- A valid socket resource created with socket_create(3) or socket_accept(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
socket_set_block(3) example
<?php
$socket = socket_create_listen(1223);
socket_set_block($socket);
socket_accept($socket);
?>
This example creates a listening socket on all interfaces on port 1223 and sets the socket to O_BLOCK mode. socket_accept(3) will
hang until there is a connection to accept.
SEE ALSO socket_set_nonblock(3), socket_set_option(3).
PHP Documentation Group SOCKET_SET_BLOCK(3)