Sockets.socketPair(3kaya) Kaya module reference Sockets.socketPair(3kaya)NAME
Sockets::socketPair - Create a joined pair of sockets
SYNOPSIS
Pair<Socket, Socket> socketPair( )
DESCRIPTION
This function creates a pair of sockets that can be used for bi-directional communication. The most common use of this is for setting up
communications between a process and its Posix.fork(3kaya) ()ed child - each process closes one of the sockets after the fork.
sockets = socketPair();
pid = fork();
if (pid == 0) {
// child process
close(sockets.fst);
// do something
} else {
close(sockets.snd);
// do something else
}
AUTHORS
Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/
LICENSE
The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
License (version 2.1 or any later version) as published by the Free Software Foundation.
RELATED Sockets.Socket(3kaya)Sockets.close(3kaya)Posix.fork(3kaya)Kaya October 2012 Sockets.socketPair(3kaya)
Check Out this Related Man Page
Sockets.pending(3kaya) Kaya module reference Sockets.pending(3kaya)NAME
Sockets::pending - Check for pending data on a socket
SYNOPSIS
Bool pending( Socket s, Int timeout=1000000 )
ARGUMENTS
s The socket
timeout The time to wait (in microseconds) before returning false. This argument may be omitted for a default of 1000000 (1 second)
DESCRIPTION
Returns whether data is pending on a socket
AUTHORS
Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/
LICENSE
The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
License (version 2.1 or any later version) as published by the Free Software Foundation.
RELATED Sockets.Socket(3kaya)Sockets.recv(3kaya)Sockets.recvByte(3kaya)Sockets.recvBytes(3kaya)Kaya October 2012 Sockets.pending(3kaya)
Hi,
My question could be stupid for most of you, but is there any difference between sockets and ports?
I work with an interface which pulls datas from certain sockets and sent a response to some other sockets.
What can I immagine under sockets?
Thanks (1 Reply)
I am in a Systems programming class this semester, and our current project is to write a program utilizing sockets and fork. For the project, I decided to make my own instant messaging program. I have the code completed, but I have a problem that keeps old clients from communicating with new... (3 Replies)
Hello guys,
I m working on a chat program with C. I finished the iterative server and it's working well. But once I add fork(), I met problems. I cannot use close or exit, otherwise I cannot accept new connection in next loop. here is my code:
.
.
.
Listen(simpleSocket, 5);
... (3 Replies)
Is it possible to trace the packages and the statuses of client's and/or server's sockets by the UNIX network administrative tools?
Two applications interact via sockets. There is no problem if they stay in the same network segment. If their hosts connected through the firewall then they aren't... (4 Replies)
Hi,
I am trying to develop a simple program that uses Sockets. I have a windows machine and MUST use C++. I found out that I can use C's Socket (#include <sys/socket.h>) API calls, but this is only possible on a unix machine. So I installed Cygwin to imitate a unix environment on my windows... (4 Replies)
Hello everyone,
I'm very interested in sockets programming
for developing games.
Right now i'm trying to develop a client,
and connecting to a host and port can be done,
but i googled lots of pages,
but i could not find how to reconnect
to the host/port if the connection is somehow... (2 Replies)
Hello there !!!!!!!!! I got some problems trying to transfer a file through sockets.
The Server must be in Java and the Client in C++
I came up with this code for the server :
BufferedInputStream input;
BufferedOutputStream output;
public void send_data() throws IOException
{
... (7 Replies)
Hello, I am trying to send a file (1 MB) through sockets and for some reason I am getting segmentation fault message and receiving in the server an incomplete file. The current file is about 3 pages long and need to send it from the client to the server. I've tried malloc with free(), I am now... (8 Replies)
Hi everybody!!
I'm studding at the university raw sockets, but i can't find a good place to read about them...
Does anybody now where i can find some information???
I've been goggling a lot but couldn't find nothing useful, just man pages...
by the way, I'm programming under Linux...
Bye! (4 Replies)
HI friends
how to find the no sockets in the aix box am using the P520
Please help it.In the prtconf am getting no of physical processor 1 and in the bindprocessor -q am getting 0 1
Please help it am not able to understand exactly
mak (6 Replies)
We have a server-client communication in our application. Sockets are used for the communication. We are using AF_INET sockets with SOCK_STREAM(TCP/IP). Also these sockets are in Non Blocking mode (O_NONBLOCK). Application is written in C++ on UNIX.
In our system the Server will write to a... (4 Replies)
I am trying to write code for a client-server scenario using AF_INET sockets..
As is usually the case, everything works fine and dandy on my machine, but gives me the following error at runtime:
send: Socket operation on non-socket
The error is thrown by the server when trying to send the... (5 Replies)