473,411 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

C socket programming - port number inheritance.

78
Hi guys. I have a question about sockets. It appears that the accept function returns a socket descriptor after creating a new socket handler. This new handler inherits the properties of the socket passed to accept, including the bound port number.
I was wondering if it's possible to change this port number so each socket uses it's own port.

Thanks.
Feb 25 '08 #1
3 2312
gpraghuram
1,275 Expert 1GB
Hi guys. I have a question about sockets. It appears that the accept function returns a socket descriptor after creating a new socket handler. This new handler inherits the properties of the socket passed to accept, including the bound port number.
I was wondering if it's possible to change this port number so each socket uses it's own port.

Thanks.

Socket communication is confined to the port and a server will be l=listening in that port to accept connectons.
I thinkit is better to open a new connection with different port and i dont think so you can change tghe port number of the accepted socket port

Raghuram
Feb 26 '08 #2
Sebouh
78
Socket communication is confined to the port and a server will be l=listening in that port to accept connectons.
I thinkit is better to open a new connection with different port and i dont think so you can change tghe port number of the accepted socket port

Raghuram
So if a server communicates with multiple clients concurrently, it does so through the same port no matter what? Won't that create some sort of congestion?
Feb 26 '08 #3
gpraghuram
1,275 Expert 1GB
So if a server communicates with multiple clients concurrently, it does so through the same port no matter what? Won't that create some sort of congestion?
Then you may want to create a server listening at every port.
Other members can comment on the idea

Raghuram
Feb 28 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ted | last post by:
Hi all, I am trying to learn C socket programming and I have a small program which is a UP client. The problem is, when I run the program, I get a runtime error - "Invalid Argument" - from a...
1
by: Rolln_Thndr | last post by:
I'm vey new to network programing and have a few rather fundemental questions. I'm creating a very basic UDP proxy server and having a few issues regarding the sockets. Is it possible to change...
5
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose...
2
by: Rene Sørensen | last post by:
We are 4 students working on a assignment, that our teacher gave use, normally we do this is C++, but the 4 of us, use C# more often that C++ so… We made a small games called reversi, now our job...
10
by: Uma - Chellasoft | last post by:
Hai, I am new to VB.Net programming, directly doing socket programming. In C, I will be able to map the message arrived in a socket directly to a structure. Is this possible in VB.Net. Can...
5
by: zxo102 | last post by:
Hi, I am doing a small project using socket server and thread in python. This is first time for me to use socket and thread things. Here is my case. I have 20 socket clients. Each client send a...
2
by: Sandy | last post by:
Hi All, I'm a newbe to socket programming, I need to work on a project that has to be developed in C++ or Visual C++ ( I have 8.0 version) console application. which will be execute from a Java...
2
by: sasimca007 | last post by:
Hello friends, When i used the following code and run i have an error: connect: Connection refused at sock.pl line 20. The code is: #!/bin/perl -w # Example of...
10
by: John Salerno | last post by:
I wrote some pretty basic socket programming again, but I'm still confused about what's happening with the buffer_size variable. Here are the server and client programs: -------------- from...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.