Link to home
Start Free TrialLog in
Avatar of shaji_am
shaji_am

asked on

Creating a new port in a Local machine

Hi,
I am working with a c++ project involving MFC. The project is for downloading some data from a remote host.
I established a connection to the server at port 6020.
For this I used the MFC class CSocket . I sucessfully sent message to the server.
 
Then the  the problem came.

The server respond only to the port number 6021(Client machine).
Actually there is no such port in my(client) system.
The only two ports available in the client is 135 and 1025 and I am able to open a socket connection to this port. But I need to open a socket connection to the port 6021( in the client side) which is absent. So tried to create a port,but failed.
My client system is working under Windows NT workstation and in the control panel there is an ICON for ports.But it is not allowing me to specify a particaular port.

1.How can I create a port in my local machine using C++.
2.Is there any difficulty in communicating with two different ports.
3.Do I need to set any thing before writing program.
4.Is there any function in C/C++ that I can make use of creating ports.
5.Can I get it done using MFC alone.

Regards
Shaji


ASKER CERTIFIED SOLUTION
Avatar of bitq
bitq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of majorjohn
majorjohn

U have to use Create(...) First for creating port and then u have to bind it with virtual port 6021 by Bind(...) See MSDN for details. It will solve ur problem.
Hello Shaji_am,

you've got several open questions

https://www.experts-exchange.com/questions/20117472/Arraya-in-SQL-server.html
https://www.experts-exchange.com/questions/20117484/Communication-between-servers.html
https://www.experts-exchange.com/questions/20247782/Database-Restore.html
https://www.experts-exchange.com/questions/20340207/display-values.html
https://www.experts-exchange.com/questions/20105806/Creating-a-new-port-in-a-Local-machine.html

you have 3 options

-accept a comment as answer
-if already solved it state the solution and get a refund of your points
-otherwise if you want to delete the question, make it clear in the thread

IMPORTANT : Experts if you got any recomendation on clsoing the question let it be known too

your last login is of 6 november 2002 so you're still active here

i will come back in 7 days and will close the question accordingly

thanks
JGould-EE Moderator