LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-05-2005, 09:04 AM   #1
Kumar
Member
 
Registered: Sep 2003
Location: Pune, India
Distribution: Red Hat
Posts: 106

Rep: Reputation: 15
Single Socket Vs Multiple Socket


Hi,

I have a client and a server and i need to transfer a fixed amount of data from the client to the server.

Please consider these two scenarios -

1. I create a program which opens a single socket connection to the server and starts sending data sequentially. Assume that there is no data is to be received.

2. I create another program with two threads which in turn create 2 sockets to the server. These two threads now start sending the data on two sockets to the server. Assume the data to send is divided between the two threads equally. Also assume that there is no data is to be received and the order in which data is send to the server is not important.

Now my question is, which of the above two process will finish first? Does creating more sockets amount to increased transfer rate? If yes, then how?

Regards,
 
Old 10-05-2005, 10:02 AM   #2
kjordan
Member
 
Registered: Jul 2004
Distribution: LFS, I felt the itch and scratched it
Posts: 227

Rep: Reputation: 31
I would say they would finish in the same amount of time theoretically unless you have more than one ethernet connection to transfer over or if your network bandwith is huge, then 2 may finish faster. Over a normal internet connection it won't be any faster since instead of downloading say a 1.5 meg file, you're now downloading 2 750k files which usually won't be any faster.
 
  


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
getpeername: Socket operation on non-socket KevStA Linux - General 6 08-25-2020 12:40 PM
socket: Socket type not supported monindra Fedora - Installation 4 01-14-2008 07:25 AM
cannot read data at server socket, though client socket sends it jacques83 Linux - Networking 0 11-15-2005 01:58 PM
Multiple clients communicating to one socket dragondad Programming 3 09-10-2005 08:22 AM
Unable to connect to UNIX socket /tmp/.esd/socket error while using grip dr_zayus69 Linux - Software 4 08-23-2005 07:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:15 AM.

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