4

What libraries are the best (in terms of performance) for network programming in C on windows and UNIX?

I'm quite interested with respect to high frequency trading.

I have heard about BSD and POSIX but I wasnt sure if there were faster performance-specific libraries?

7
  • 1
    What are your requirements? Have you demonstrated that the OS-provided networking facilities do not meet those requirements? Commented Oct 24, 2011 at 1:22
  • 1
    The OS-provided networking is quite capable of saturating a gigabit ethernet connection. How fast is your connection to the internet? Commented Oct 24, 2011 at 1:29
  • 1
    What do you mean by OS-provided networking facilities? I wish to write some server-client demo programs in C and it was my understanding the original C standard contains no networking libraries, so I would have to use something else (like bsd, POSIX etc), atleast in the case of Windows? Im unsure about UNIX Commented Oct 24, 2011 at 2:02
  • 1
    The C Standard provides no networking libraries - 'tis true. But if you're working on a Unix-like platform, the 'standard' (as in 'provided by the OS') libraries will include BSD sockets, and those will perform well for you. On Windows, there's probably a wholly different interface (WinSock?). Or you can use Cygwin or Mingw to provide BSD sockets. They're all likely to perform well enough too. Commented Oct 24, 2011 at 6:00
  • @Jonathan WinSock is derived from BSD, so they are similiar. Commented Oct 24, 2011 at 6:03

2 Answers 2

6

The fastest way would be to use the OS's networking functions: socket(), setsockopt(), connect(), listen(), send(), recv() etc. etc.

There are subtle differences between them on several OS's.

To cope with this, there are wrappers around them in several libraries, e.g. in Qt (at least, IIRC). I don't think anything will noticeably slow down if you use them...

Sign up to request clarification or add additional context in comments.

3 Comments

Hi, do i just need to include windows.h to get access to those?
I suppose so, but I am not sure. Don't program much under windows.
A great resource on this type of low level network programming is beej.us/guide/bgnet . The content is mostly unix focused but has some commentary on usage in windows.
0

What about ZeroMQ. [http://www.zeromq.org/][1]

It's a faster, easy to code and also can be used as Message Queue.

1 Comment

You should mention some of the multiple options available instead of must a single one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.