LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-25-2010, 04:54 AM   #1
nagaraju1024
LQ Newbie
 
Registered: Jun 2010
Posts: 5

Rep: Reputation: 0
Sending and receiving data simultaneously using BSD sockets


Hi Friends,

I wold like to send a data using one thread and receive a data using other thread by using a same socket connection using USD sockets. The calls i am using for sending and receiving are send(), recv(). let me know is it possible to send and receive the data parallel(Full duplex communication)?

Regards,
Nagaraju D
 
Old 06-25-2010, 06:25 AM   #2
kumar.manoj412
Member
 
Registered: May 2007
Location: India
Distribution: Mandriva, Ubuntu
Posts: 43
Blog Entries: 1

Rep: Reputation: 16
Quote:
Originally Posted by nagaraju1024 View Post
Hi Friends,

I wold like to send a data using one thread and receive a data using other thread by using a same socket connection using USD sockets. The calls i am using for sending and receiving are send(), recv(). let me know is it possible to send and receive the data parallel(Full duplex communication)?

Regards,
Nagaraju D
Hello,

It depend on the application, if you want to send data after a client has sent you a request then your previous code is ok. If you want to initiate the sending then you need to create the connection first, that means your machine is a client and the other machine must run a server.

So first start a server on other machine and after that run ur client process on ur machine. I think this is the only way.
 
Old 06-27-2010, 10:17 PM   #3
nagaraju1024
LQ Newbie
 
Registered: Jun 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Hi i will explain my scenerrio clearly. I have client and server programme. In side my server program i have two threads one thread is used for receiving the data and other thread is used for sending the data. I started the server and client and server accepeted the connection. But both server and client are sending data parallelly but afther server is receiving all the data only client is started receiving. But i want to receive data in both server and client sides simultaneously.

Quote:
Originally Posted by kumar.manoj412 View Post
Hello,

It depend on the application, if you want to send data after a client has sent you a request then your previous code is ok. If you want to initiate the sending then you need to create the connection first, that means your machine is a client and the other machine must run a server.

So first start a server on other machine and after that run ur client process on ur machine. I think this is the only way.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in sending/receiving using sockets between two systems using IPv6 addresses btp10 Linux - Networking 1 03-08-2010 09:43 AM
problem in receiving data in udp sockets ramya_ts Linux - Embedded & Single-board computer 1 01-07-2009 02:12 PM
sending and receiving data between laptops ashlesha Linux - Networking 2 04-04-2007 12:45 PM
Sending and receiving data to through Serial Port kalyan.penujeevi Programming 1 08-07-2006 07:55 AM
Receiving/sending data from other programs OpsVentus Programming 4 12-18-2005 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration