LinuxQuestions.org
Help answer threads with 0 replies.
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 09-22-2004, 10:08 AM   #1
oriel_gizmo
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, 02:16 PM   #2
KneeLess
Member
 
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, 04:33 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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, 06:20 PM   #4
infamous41md
Member
 
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:
http://www.ecst.csuchico.edu/~beej/guide/net/html/
 
  


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

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

All times are GMT -5. The time now is 11:45 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