Sponsored Content
Full Discussion: open a socket
Top Forums Programming open a socket Post 302300642 by Corona688 on Tuesday 24th of March 2009 04:58:39 PM
Old 03-24-2009
Its also problematic in that sometimes hostname look up does take a few seconds, it has to give it time to look.
 

9 More Discussions You Might Find Interesting

1. Programming

Socket Programming socket

Hello, I actually try to make client-server program. I'm using SCO OpenServer Release 5.0.0 and when I try to compile my code (by TELNET) I've got this error : I'm just using this simple code : and I get the same error if I use : If someone can help me, Thanks (2 Replies)
Discussion started by: soshell
2 Replies

2. UNIX for Dummies Questions & Answers

Which application has a TCP socket open

If I do a netstat -a I can see all the sockets currently open, is there a way that I can tell which application is holding open these sockets ? (3 Replies)
Discussion started by: murphyboy
3 Replies

3. UNIX for Dummies Questions & Answers

how to find the owner PID of open socket on Solaris9?

Hi all, I am trying to connect the open socket and its owner PID on my Solaris9 system. But it seems not very easy. As netstat is not as powerful as it is on Linux platform, without the "-program" option, and "lsof -i <UDP|TCP>@<hostIP>" won't show the one i want although it lists some... (1 Reply)
Discussion started by: sleepy_11
1 Replies

4. UNIX for Dummies Questions & Answers

open a socket on a server

Hello, I want to test a firewall rule between 2 servers A & B. I need a command that will open a socket on the server A such as: themagiccommand MyPort And on the client server B, i will run the command telnet IP_serverA Myport Can you help me ? Thank you Gunther (0 Replies)
Discussion started by: gunbol
0 Replies

5. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

6. Programming

which socket should socket option on be set

Hi all, On the server side, one socket is used for listening, the others are used for communicating with the client. My question is: if i want to set option for socket, which socket should be set on? If either can be set, what's the different? Again, what's the different if set option... (1 Reply)
Discussion started by: blademan100
1 Replies

7. Programming

socket function to read a webpage (socket.h)

Why does this socket function only read the first 1440 chars of the stream. Why not the whole stream ? I checked it with gdm and valgrind and everything seems correct... #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include... (3 Replies)
Discussion started by: cyler
3 Replies

8. Programming

Error with socket operation on non-socket

Dear Experts, i am compiling my code in suse 4.1 which is compiling fine, but at runtime it is showing me for socket programming error no 88 as i searched in errno.h it is telling me socket operation on non socket, what is the meaning of this , how to deal with this error , please... (1 Reply)
Discussion started by: vin_pll
1 Replies

9. IP Networking

Clarification - Setting socket options at the same time when socket is listening

I need clarification on whether it is okay to set socket options on a listening socket simultaneously when it is being used in an accept() call? Following is the scenario:- -- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Discussion started by: jake24
2 Replies
SOCKET_RECVFROM(3)							 1							SOCKET_RECVFROM(3)

socket_recvfrom - Receives data from a socket whether or not it is connection-oriented

SYNOPSIS
int socket_recvfrom (resource $socket, string &$buf, int $len, int $flags, string &$name, [int &$port]) DESCRIPTION
The socket_recvfrom(3) function receives $len bytes of data in $buf from $name on port $port (if the socket is not of type AF_UNIX) using $socket. socket_recvfrom(3) can be used to gather data from both connected and unconnected sockets. Additionally, one or more flags can be specified to modify the behaviour of the function. The $name and $port must be passed by reference. If the socket is not connection-oriented, $name will be set to the internet protocol address of the remote host or the path to the UNIX socket. If the socket is connection-oriented, $name is NULL. Additionally, the $port will contain the port of the remote host in the case of an unconnected AF_INET or AF_INET6 socket. PARAMETERS
o $socket - The $socket must be a socket resource previously created by socket_create(). o $buf - The data received will be fetched to the variable specified with $buf. o $len - Up to $len bytes will be fetched from remote host. o $flags - The value of $flags can be any combination of the following flags, joined with the binary OR ( |) operator. Possible values for $flags +-------------+---------------------------------------------------+ | Flag | | | | | | | Description | | | | +-------------+---------------------------------------------------+ | | | | MSG_OOB | | | | | | | Process out-of-band data. | | | | | | | | MSG_PEEK | | | | | | | Receive data from the beginning of the receive | | | queue without removing it from the queue. | | | | | | | |MSG_WAITALL | | | | | | | Block until at least $len are received. However, | | | if a signal is caught or the remote host discon- | | | nects, the function may return less data. | | | | | | | |MSG_DONTWAIT | | | | | | | With this flag set, the function returns even if | | | it would normally have blocked. | | | | +-------------+---------------------------------------------------+ o $name - If the socket is of the type AF_UNIX type, $name is the path to the file. Else, for unconnected sockets, $name is the IP address of, the remote host, or NULL if the socket is connection-oriented. o $port - This argument only applies to AF_INET and AF_INET6 sockets, and specifies the remote port from which the data is received. If the socket is connection-oriented, $port will be NULL. RETURN VALUES
socket_recvfrom(3) returns the number of bytes received, or FALSE if there was an error. The actual error code can be retrieved by calling socket_last_error(3). This error code may be passed to socket_strerror(3) to get a textual explanation of the error. EXAMPLES
Example #1 socket_recvfrom(3) example <?php error_reporting(E_ALL | E_STRICT); $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); socket_bind($socket, '127.0.0.1', 1223); $from = ''; $port = 0; socket_recvfrom($socket, $buf, 12, 0, $from, $port); echo "Received $buf from remote address $from and remote port $port" . PHP_EOL; ?> This example will initiate a UDP socket on port 1223 of 127.0.0.1 and print at most 12 characters received from a remote host. CHANGELOG
+--------+----------------------------------------+ |Version | | | | | | | Description | | | | +--------+----------------------------------------+ | 4.3.0 | | | | | | | socket_recvfrom(3) is now binary safe. | | | | +--------+----------------------------------------+ SEE ALSO
socket_recv(3), socket_send(3), socket_sendto(3), socket_create(3). PHP Documentation Group SOCKET_RECVFROM(3)
All times are GMT -4. The time now is 10:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy