Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Socket Programming

Status
Not open for further replies.

Rockman75

Technical User
Nov 2, 2002
17
US
Hi, all

Question. Im wondering if I am able to close any current unused TCP/UDP port opened by another processes.

I wanna make a firewall-like program to shut down unused ports. (TCP/UDP)

So, If I write a program with VC++6.0, Can i just simply use a function, createsocket() and closesocket()? If thats the case, how do I bind the socket and port. See what I maen? Sorry I cant explain well, but if you see what Im tryin to find, ping me pls....thanx
 
Hi Rockman75 ,
Me too wondering how to do that using VC++.. I created a server and client using CAsyncSocket class. Ok i can create the socket but am unable to bind as it is always failing..
Did you get any solution using VC++?
Thanks in advance
PANKAJ
 
There is httpsvr - sample on MSDN with CAsyncSocket etc.
 
How can this be implemented..

That is, on startup, the desktop timer opens a socket (with a known port
number) on which it listens for "events" from the server. During login, have the server take note of the IP address that the client is connecting from, and after successful log-in, the server will connect to the desktop timer at the known port number on that address and tell it to update itself with a particular value. The timer takes this value and starts counting down. When it's nearing the end, it connects to the server to obtain a new value. However, at any point in time, the server can connect to the desktop timer at the socket on which it is listening for events, and tell it to update itself with a new value. E.g., when the user prints, or some other event happens, the server can connect to the client to give it the new balance. This means that the desktop timer has to have at least 2 threads -- one which does the counting down, and one which listens for an event from the server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top