Sponsored Content
Top Forums Shell Programming and Scripting simple socket programming in perl Post 302228253 by jim mcnamara on Saturday 23rd of August 2008 05:31:57 PM
Old 08-23-2008
IO::select is also a standard unix sockets approach.
 

10 More Discussions You Might Find Interesting

1. Programming

Socket programming

Suppose i am writing a C program which is going to use Socket calls. I want to use a Unix port for my Socket. How can i determine a port which is not already in use? (1 Reply)
Discussion started by: Nadeem Mistry
1 Replies

2. 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

3. Programming

Need Help Regarding Socket Programming

Can anyone plz me. I need a sample code for the following description. Its urgent. It is C/Socket program with the following descriptions: NAME coreadServer - Concurrent Readers Server. coreadClient - Concurrent Readers Client. SYNOPSIS coreadServer <OutputFile> coreadClient <n>... (1 Reply)
Discussion started by: priya.vmr
1 Replies

4. Programming

help regarding socket programming

i m using sockets for setting up a connection between a server and a client. When the clients gets connected to the server, its ip is conveyed to the server through one of the predefined structures in c library... i save this ip address in an array....1st client's ip address goes to the zeroth... (1 Reply)
Discussion started by: abmxla007
1 Replies

5. UNIX for Advanced & Expert Users

socket programming

Hi, I am trying to connect to more than 60 servers to perform some actions remotely. for this I am using ssh2. But its taking lot of time. Though i am running the command in background, still its taking long time to execute.. Any one let me know can we use sockets instead of ssh2 for... (3 Replies)
Discussion started by: pvamsikr
3 Replies

6. Programming

Help with socket programming in C

hi guys i got this code trying to make connection between the server and multi clients but when i do ./server i got message server waiting then when i run ./client it says client 1 nosuch file i dont know whats that should i use any argument plz help how to compile and run and whats the expected... (1 Reply)
Discussion started by: kedah160
1 Replies

7. UNIX for Dummies Questions & Answers

hi i need help with socket programming

in socket programming how can i : Create for example 3 blank files, namely: server, client, network •Server: act as servers/provider, will receive all requests from different client •Client: requesters •Network: middle-layer of communication between server & client any tips or... (6 Replies)
Discussion started by: kedah160
6 Replies

8. Programming

help with socket programming in c

i'm doing a simple program in socket programming on c i have server that can handle 2clients in a single machine i'm running ubuntu linux so i got it work but the probelm when clients send a message the server will echo it but i cant distinguish which client send the message client 1 or client... (7 Replies)
Discussion started by: kedah160
7 Replies

9. Programming

socket programming

how to include socket.h in visual studio 2005.. (2 Replies)
Discussion started by: asd123
2 Replies

10. Shell Programming and Scripting

Socket Programming in Perl

Hi All I am getting an error when using the below code Receiver use IO::Socket; $sock = new IO::Socket::INET (LocalHost => 'goldengate', LocalPort => 1200, Proto => 'tcp', Listen => 5, Reuse => 1 ); die "Socket could not be created. Reason: $!" unless $sock; while ($new_sock =... (5 Replies)
Discussion started by: parthmittal2007
5 Replies
GETFDS(3PVM)							  PVM Version 3.4						      GETFDS(3PVM)

NAME
pvm_getfds - Get file descriptors in use by PVM. SYNOPSIS
C int nfds = pvm_getfds( int **fds ) Fortran Not Available PARAMETERS
fds Returns integer array of file descriptors. DESCRIPTION
A PVM task uses sockets to communicate between libpvm and other tasks or the pvmd. It is sometimes useful to know the file descriptor num- bers of the sockets in order to wait from input from either PVM messages or an external source. For example, the PVM console waits on both keyboard input and notify messages. Input can be multiplexed by polling all sources, but this wastes cpu cycles. Instead, the select() system call can be used to wait until one or more sources of input are ready. If it completes successfully, pvm_getfds returns the number of sockets in use, and the file descriptor numbers in an array (allocated and freed by libpvm). At least one socket always exists (from task to pvmd), and its descriptor is always fds[0]. The number of sockets varies as direct routes are established to other tasks. It can be difficult to track the set of file descriptors if direct routing is enabled, because routes are created as messages are either sent or received. The simplest approach is to disable direct routing. When select returns with a PVM file descriptor ready, a complete message may be ready to be received, or instead only a fragment may be waiting. pvm_nrecv or pvm_probe should be used test without blocking. RESTRICTIONS
pvm_getfds is only available when running PVM on a Unix or similar system. EXAMPLES
The following program fragment waits until either keyboard input is available, or a PVM message has arrived. int *d; fd_set r; pvm_setopt(PvmRoute, PvmDontRoute); pvm_getfds(&d); FD_ZERO(&r); FD_SET(0, &r); FD_SET(d[0], &r); while(1) { if (select(d[0] + 1, &r, (fd_set*)0, (fd_set*)0, (struct timeval*)0) > 0) { if (FD_ISSET(0, &r)) ... /* read keyboard input */ if (FD_ISSET(d[0], &r) && pvm_nrecv(-1, -1) > 0) ... /* got a PVM message */ } } ERRORS
The following error condition can be returned by pvm_getfds: PvmSysErr pvmd not responding. SEE ALSO
pvm_notify(3PVM), pvm_trecv(3PVM) 22 Nov, 1994 GETFDS(3PVM)
All times are GMT -4. The time now is 04:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy