Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

Rep: Reputation: 15
Single Socket Vs Multiple Socket


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?

Old 10-05-2005, 10:02 AM   #2
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
socket: Socket type not supported monindra Fedora - Installation 4 01-14-2008 07:25 AM
getpeername: Socket operation on non-socket KevStA Linux - General 5 04-26-2006 02:11 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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:22 AM.

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