Re: Transfer files using sockets, urgent!!

petekevin@xxxxxxxxx wrote:
> Stuff.

A couple of things...

1) Why is your sending code called recv.c and your receiving code
called send.c?

2) Your file sending is very very basic:

A) Open a listening socket on host A
- If you get a connection...
--> while (1) { read (socket), write (fd) }

B) Open an out going port from host B to target
- If you successfully connect...
--> while (1) { read (fd), write (socket) }

It really doesn't get much more efficient (or basic) than that.
If you want to speed things up you could -try- using UDP to
send some data and TCP for header information...? I doubt you'll
get a massive performance improvement over what you've already

3) Your connect problem could be any number of things. Try
looking at the errno after the connect fails.

(look here:

It could be anything but I'd guess ECONNREFUSED or ETIMEDOUT.

4) What was the fourth thing again...? I can't recall. Ah, I suggest
you look at using a non-blocking socket approach, otherwise your
network code is going to end up having to be put in it's own thread
to avoid the application hanging when the network blocks...

5) Woa! Did you say 2 gig in under 4 minutes? You realize that's a
transfer rate of er... no calculator... 8 megabytes a second?
Its been a while, but isn't a 100 Mbit connection only capable
of doing 1 meg / second? Are you on a fiber-optic network or
something? Otherwise you're probably being speed limited by the
network hardware you have... (If I have my numbers wrong, someone
please correct me...)


Relevant Pages

  • Re: 2 pc network - cant see host files from pc 2 on pc 1
    ... If the second card is lost on HOST PC then DSL Internet does not connect. ... Ditch the second network card in the one ...
  • Re: Emailing web form information to me
    ... Which version of Publisher are you using? ... both FTP uploading and FPSE uploading. ... use of FPSE and using the form program provided by your host? ... Instead you need to map a network ...
  • 2wire router configuration
    ... firewall on this router and to configure my network ... Go to Home Network -> Advanced Settings ... X Default DHCP Pool ... Configure host to use DHCP with host name sent ...
  • Re: Do I Have A Firewalled LAN Run By ISP In Between?
    ... from that host while at host ... running a layer within a layer, with a complex network address translation ... application called "Internet Connection Sharing". ... what those packets are for, ...
  • RE: A question for the list...
    ... attempts to remove the virus from the host. ... -If a command can be given in a channel to "shut down" the network of hosts, ... wireless LANs require network security policies ... that are enforced to protect WLANs from known vulnerabilities and threats. ...