05-07-2010
am checking error codes
its returning error reading from socket :bad address
on the server side error writing to socket:bad address
how can I send 2 different integers , where buffer is a char type ?
10 More Discussions You Might Find Interesting
1. Programming
How can 'popen()' be used for reading and writing to opening pipe?
If i try 'popen("prog", "rw")'
and then put and get chars - it does
not work.
What is wrong? (1 Reply)
Discussion started by: szzz
1 Replies
2. Shell Programming and Scripting
I am trying to write a script that will do a sql statement. But in the sql I will have a list (1,2,3,4).
How would I go about asking for the input from the user running the script, and then transferring that back into the list as say ($var1,$var2,$var3)?
It would be somewhat like this:
... (1 Reply)
Discussion started by: Captain
1 Replies
3. Shell Programming and Scripting
I need to find all the files that have group Read or Write permission or files that have user write permission.
This is what I have so far:
find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}'
It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
4. Programming
Hi all,
I have a problem with some read/write functions.
I have a .bin file which contains a lot of structures as follows:
struct alumno
{
char id;
char apellido1;
char apellido2;
char nombre;
float nota1p;
float nota2p;
float notamedia;
char photofilename;
};
What I have... (3 Replies)
Discussion started by: Attenea
3 Replies
5. IP Networking
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies
6. Programming
HI
I need to implement a client/server TCP application. the customer is the client and the bartender is the server.
When the customer enter the Bar, client connects to the server
Server should reply the client immediately. Other wise if the server is busy, it should send an update message... (10 Replies)
Discussion started by: lixiao1212
10 Replies
7. Shell Programming and Scripting
EDIT: Nevermind. I found a forth kludge to get around the psed requirement!
Short version: I'm trying to use the "w" flag with psed to write all substituted lines into another file. No matter how many times I read the man pages or search with Google, I can't seem to find the proper syntax... (0 Replies)
Discussion started by: CluelessPerson
0 Replies
8. Shell Programming and Scripting
Hi Everyone,
newbie here, please help me i can't read the code i'm confused reading this code.
select c.net_svc_id, c.inst_st_dt into ${REO_RECON_USERID_LUZON_TEMP} from ${WO_INST_SITE_COMP_FIELDS} a, ${WO_INST_SITE_COMPONENTS} b, ${WO_INST} c where a.cust_ac_no = b.cust_ac_no and... (3 Replies)
Discussion started by: nikki1200
3 Replies
9. Shell Programming and Scripting
I have got a file in following format:
AAAAAAA
BBBBBBBB
CCCCCCC
DDDDDDD
I am trying to read this file and out put it in following format:
AAAAAAA,BBBBBBB,CCCCCCC,DDDDDD
Preferred method is shell or Perl.
Any help appreciated. (11 Replies)
Discussion started by: Araoki
11 Replies
10. Programming
Can someone help me to write this program in C in QNX?
Using the FIFO queues write a simple communication system consisting of programs write and read. The program write the parameters given strings enclosed in single quotes. These strings are written to the FIFO file. Reads the program read... (1 Reply)
Discussion started by: ebasse2
1 Replies
LEARN ABOUT PHP
socket_getpeername
SOCKET_GETPEERNAME(3) 1 SOCKET_GETPEERNAME(3)
socket_getpeername - Queries the remote side of the given socket which may either result in host/port or in a Unix filesystem path, dependent on
its type
SYNOPSIS
bool socket_getpeername (resource $socket, string &$address, [int &$port])
DESCRIPTION
Queries the remote side of the given socket which may either result in host/port or in a Unix filesystem path, dependent on its type.
PARAMETERS
o $socket
- A valid socket resource created with socket_create(3) or socket_accept(3).
o $address
- If the given socket is of type AF_INET or AF_INET6, socket_getpeername(3) will return the peers (remote) IP address in appropri-
ate notation (e.g. 127.0.0.1 or fe80::1) in the $address parameter and, if the optional $port parameter is present, also the
associated port. If the given socket is of type AF_UNIX, socket_getpeername(3) will return the Unix filesystem path (e.g.
/var/run/daemon.sock) in the $address parameter.
o $port
- If given, this will hold the port associated to $address.
RETURN VALUES
Returns TRUE on success or FALSE on failure. socket_getpeername(3) may also return FALSE if the socket type is not any of AF_INET,
AF_INET6, or AF_UNIX, in which case the last socket error code is not updated.
NOTES
Note
socket_getpeername(3) should not be used with AF_UNIX sockets created with socket_accept(3). Only sockets created with socket_con-
nect(3) or a primary server socket following a call to socket_bind(3) will return meaningful values.
Note
For having socket_getpeername(3) to return a meaningful value, the socket it is applied upon must of course be one for which the
concept of "peer" makes sense.
SEE ALSO
socket_getsockname(3), socket_last_error(3), socket_strerror(3).
PHP Documentation Group SOCKET_GETPEERNAME(3)