Sponsored Content
Full Discussion: Socket programming
Top Forums Programming Socket programming Post 302420896 by jim mcnamara on Wednesday 12th of May 2010 10:13:41 PM
Old 05-12-2010
Quote:
1. open user specified port for TCP connection and set LISTEN mode. I must be able to respond to client request but I must also be able to send data to clientin case of an event
Is the lcient listening on a known port. If not you cannot call connect() and get a connection to your client. It has nothing to do with the listening port, necessarily, unless you have a simplex connection (both sides have a listener).

I personally believe select() is a better choice for what you are doing than is poll().
Of course that is opinion. Some implementaions support pselect() = even better.

Consider some reading. Normally what socket apps do:
loop thru their collection of listeners looking for a connect request. Take a nanosleep() or usleep() and loop again.

select() is good for this. When you get a connection request create a thread to play with it. The thread exits when the socket is closed on the remote side. Or the connection errors out.

I think beej still has this site going, it is a very good place to get some basic ideas. I just connected it still works. Amazing.
Beej's Guide to Network Programming

Last edited by jim mcnamara; 05-13-2010 at 06:14 AM..
This User Gave Thanks to jim mcnamara For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

Socket Programming

Dear Reader, Is there any way to check up socket status other than 'netstatus ' Thanks in advance, (1 Reply)
Discussion started by: joseph_shibu
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. IP Networking

socket programming

my system is a stand alone system... i want to try doing socket porgramming..ihave heard that this is usually done during testing... how can i do that....? (6 Replies)
Discussion started by: damn_bkb
6 Replies

5. IP Networking

socket programming

Hello Everyone Iam working on tcp/ip programming.with some time interval server has to send data.client has to close the connection and to open the connection between the time interval.this is the scenario when iam closing the connection in client side the connection terminates.how to... (1 Reply)
Discussion started by: sureshvaikuntam
1 Replies

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

7. UNIX for Advanced & Expert Users

socket programming

can we send udp message to a destination ip address .. without having an ip address configured in our machine using recvfrom ? (2 Replies)
Discussion started by: Gopi Krishna P
2 Replies

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

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

10. Programming

socket programming

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

NAME
LAM - introduction to Local Area Multicomputer (LAM) DESCRIPTION
LAM is an MPI programming environment and development system for a message-passing parallel machine constituted with heterogeneous UNIX computers on a network. With LAM, a dedicated cluster or an existing network computing infrastructure can act as one parallel computer solving one compute-intensive problem. LAM emphasizes productivity in the application development cycle with extensive control and moni- toring functionality. The user can easily debug the common errors in parallel programming and is well equipped to diagnose more difficult problems. LAM features a full implementation of the MPI communication standard, with the exception that the MPI_CANCEL function will not properly cancel messages that have been sent. User Information Users are strongly encouraged to read the LAM/MPI User's Guide that is included with the LAM/MPI distribution, and is provided on the main LAM/MPI web site (http://www.lam-mpi.org/). Up-to-Date Information The LAM home page can be found on the World Wide Web at: http://www.lam-mpi.org/. It should be consulted for the most current information about LAM, as well as updates, patches, etc. SEE ALSO
Overview of Commands and Libraries introu(1), introc(2), INTROF(2) System Services Interface (SSI) lamssi(7), lamssi_boot(7), lamssi_coll(7), lamssi_rpi(7) Starting / Stopping LAM recon(1), lamboot(1), lamhalt(1), lamnodes(1), lamwipe(1), tping(1), lamgrow(1), lamshrink(1) Compiling MPI Applications mpicc(1), mpiCC(1), mpif77(1) Running MPI Applications mpirun(1), lamclean(1) Running Non-MPI Applications lamexec(1) Monitoring MPI Applications mpitask(1) Unloading MPI Trace Data lamtrace(1) Reference Documents "LAM/MPI Installation Guide" included in the LAM/MPI distribution and available on http://www.lam-mpi.org/ "LAM/MPI User's Guide" included in the LAM/MPI distribution and available on http://www.lam-mpi.org/ "LAM Frequently Asked Questions" at http://www.lam-mpi.org/faq/ "MPI Primer / Developing with LAM", Ohio Supercomputer Center "MPI: A Message-Passing Interface Standard", Message-Passing Interface Forum, version 1.1 at http://www.mpi-forum.org/ "MPI-2: Extensions to the Message Passing Interface", Message Passing Interface Forum, version 2.0 at http://www.mpi-forum.org/ MPI Quick Tutorials "LAM/MPI ND User Guide / Introduction" at http://www.lam-mpi.org/mpi/tutorials/lam/ "MPI: It's Easy to Get Started" "MPI: Everyday Datatypes" "MPI: Everyday Collective Communication" Guaranteed Envelope Resources "Robust MPI Message Delivery Through Guaranteed Resources", MPI Developer's Conference, 1995 LAM 7.1.4 July, 2007 LAM(7)
All times are GMT -4. The time now is 08:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy