LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-15-2008, 08:46 PM   #1
lbqhope
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
How to get socket number after connect()


Hi all:

How can i get the socket number after using the connect()?

In this time, the socket number is assigned automatically, i want to know and save this socket number.


Thanks!

Brian
 
Old 10-16-2008, 03:11 PM   #2
mastemmer
Member
 
Registered: Jul 2007
Location: Porto Alegre, Brazil
Distribution: Slackware
Posts: 44

Rep: Reputation: 17
Are you doing socket programming in C under POSIX?
I wrote a skeleton of TCP client-server in
http://www.ee.pucrs.br/~stemmer/socket/clisock.c
and
http://www.ee.pucrs.br/~stemmer/socket/mservsock.c
Also there is a tutorial on socket programming in
http://beej.us/guide/bgnet/
You get the socket descriptor from the socket function an then pass it as a parameter to connect.

M. Stemmer
 
Old 10-16-2008, 11:25 PM   #3
lbqhope
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Talking Thank you buddy~

Hi buddy,

now, i am working in c++ under posix

Thanks for your material.


Brian
 
  


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
Can't connect to UNIX socket /var/run/clamav/clamd.socket ganick Linux - Server 8 08-01-2008 01:22 PM
Unable to connect to UNIX socket /tmp/.esd/socket error while using grip dr_zayus69 Linux - Software 4 08-23-2005 07:28 PM
max socket number sector Linux - General 1 06-30-2003 09:09 AM
max socket number sector Linux - Software 0 06-30-2003 08:52 AM
connect: socket operation on non-socket bit7 Linux - Networking 0 02-18-2003 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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