Review your favorite Linux distribution.
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 09-22-2004, 11:08 AM   #1
LQ Newbie
Registered: Aug 2004
Location: UK
Distribution: debian
Posts: 5

Rep: Reputation: 0
Sockets Porting from Windows to Linux

I am porting at TCPIP program from windows to linux. In windows there are events like FD_ACCEPT, FD_READ, FD,WRITE and FD_CONNECT what is the equivalent ones to use in Linux. Any examples would be welcome.
Old 09-22-2004, 03:16 PM   #2
Registered: May 2003
Distribution: Debian GNU/Linux 3.0 Sid, OpenBSD 3.5
Posts: 190

Rep: Reputation: 30
man 2 socket
Old 09-22-2004, 05:33 PM   #3
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,683

Rep: Reputation: 219Reputation: 219Reputation: 219
There are functions like accept(), read(), write() etc. All have their manpages, for example 'man 2 accept' will show accept's manpage (with syntax, return values etc).

The list of all (if I make no mistake here) functions you need: socket, bind, listen, accept, read, write, close.
Old 09-22-2004, 07:20 PM   #4
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
You sound like you're used ti using an event loop and WM_SOCKET messages. I don't know if you plan on doing GUI programming, and I don't know if the linux gui toolkits provide a similar functionality. However, what you do have availabe is the select() function. You can pass to it a number of socket descriptors, and a timeout, it returns when the time is up or one of the sockets is readable/writeable. You don't have any type of "connect" or "accept" though, just readable and writeable. You have to determine what's going on yourself. 'man 2 select' and I'd read this if you want a real understanding of what's going on, which you probably do:


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
linux to windows porting Atrocity Linux - Software 5 02-19-2013 09:36 AM
porting windows drivers to linux? bizx Linux - Hardware 7 07-08-2004 05:30 PM
Porting C++ code from windows to Linux ashwinipahuja Programming 9 06-03-2004 03:09 AM
Porting C++ code from windows to Linux ashwinipahuja Linux - General 1 03-22-2004 03:57 AM
Porting C++ Project from Windows to Linux?? ashwinipahuja Programming 0 03-20-2004 02:12 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:38 PM.

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