|
gee, its a bit hard to answer a question like this without knowing some in-between ..
'Usually', your server would have
an internal TCP/IP Address on your internal network
and/or an address that is NAT'd (Network Address Translated) to a public TCP/IP address that is visible to the internet - there are various ways to do this depending on wether you have multiple dmz's, firewalls, external switches/routers etc
Depending on your company internals then, your client may be able to access the internet and the public address of your server directly, or it may need to go through a proxy server that acts as an interface betwen your internal network and the internet ...
thats a pretty basic description ..without knowing more of your setup etc its a bit hard to give you an answer
'g'
|
|
|
|
|
Thanks for the reply. Sorry for being so vague, but I didn't want the problem to seem so huge and specific that it's impossible to help with
It's not within a company that this program will be used, if that helps. Basically it's just some networking framework to lay down for a game I'd like to toy around with.
Whatever network stuff I write needs to be written in Win32, and compatible with WinXP. The code snippets I've found can compile and run properly.
The thing about the 2 addresses--one on the internal network and a second, "global" address--yes I've seen that. My internal address is something like 192.168.0.1, and I can find my external address at this place. I asked a couple friends to use the same service to find their external address and they couldn't receive any information from my program when theirs was listening.
My setup is a simple modem/router in the house. Any target machines I talk to have either that same setup, or a DSL line hooked directly to it.
If you need anymore info, please let me know. This is an itch that I need to scratch--I've needed to beef up my networking knowledge and I've put it off too long
Take care,
Michael
|
|
|
|
|
matrix2681 wrote: Whatever network stuff I write needs to be written in Win32, and compatible with WinXP. The code snippets I've found can compile and run properly.
thats 'easy enough'
well, I guess, the first thing to do is some basic testing, yes ?
so you have a client and a server app - they should be able to run on your own home network - so, you could use two machines plugged into a switch/hub, with different 192.168.0.x addresses on each of them - but here's a thought - get a copy of VMWare Desktop, set up two VM's, then run your client/server on them ... really, there's nothing to stop you testing both components on one machine anyway, using 127.0.0.1 (which most NIC cards assign as a local/loop address)
Then, you seem to have a dial up account (the modem is a giveaway) - I'd talk to your ISP about the address they give you it could be that you need a 'static'/fixed ip address on the 'outside' ie public space .. this will help you when you have to go through firewalls etc because if its 'dynamic' it will change all the time which is a real pain
It really sounds like apart from testing the basic server/client, you need more help than I can give you - I dont set networks up for a living - we have a team that specialises in that, and becuase I work for a huge company, its quite involved - multiple firewalls, 'dmz' seperating internal network from public space etc
'g'
|
|
|
|
|
Garth J Lancaster wrote: so you have a client and a server app - they should be able to run on your own home network - so, you could use two machines plugged into a switch/hub, with different 192.168.0.x addresses on each of them - but here's a thought - get a copy of VMWare Desktop, set up two VM's, then run your client/server on them ... really, there's nothing to stop you testing both components on one machine anyway, using 127.0.0.1 (which most NIC cards assign as a local/loop address)
That makes sense. This is something I've already tried, and it works flawlessly (with the testing between two in-network machines I mean). I can even test both apps on the same computer with good results.
Garth J Lancaster wrote: Then, you seem to have a dial up account (the modem is a giveaway) - I'd talk to your ISP about the address they give you it could be that you need a 'static'/fixed ip address on the 'outside' ie public space .. this will help you when you have to go through firewalls etc because if its 'dynamic' it will change all the time which is a real pain
Actually it's a DSL setup, but what you said still holds true--dynamic IP would be a problem if I'm expecting it to stay static. A question though, totally out of left field: If I had a server app running on a static IP and any client running on a dynamic IP, is it possible to send the current IP assigned to the client out to the server?
Garth J Lancaster wrote: It really sounds like apart from testing the basic server/client, you need more help than I can give you - I dont set networks up for a living - we have a team that specialises in that, and becuase I work for a huge company, its quite involved - multiple firewalls, 'dmz' seperating internal network from public space etc
Aw man... Well you have helped me quite a bit so far, with just talking about how basic networking works. Sometimes just being told a few things many many times helps me figure out what I'm doing wrong
If you still have more suggestions though, I'm open. Thank you so much for your time.
Michael
|
|
|
|
|
matrix2681 wrote: If I had a server app running on a static IP and any client running on a dynamic IP, is it possible to send the current IP assigned to the client out to the server?
not 100% sure what you mean - if you mean, can a server tell what tcp/ip address is connecting to it, from memory, 'yes', Im not sure if its actually part of the protocol/'stack' or in the 'connect' sequence, Ive a feeling that its there somewhere (ie, you dont have to explicitly send the client address to the server) .. the issue then is, how do you know who that connection belongs to - that might require a challenge/response scenario where the client identifes itself by some other means - and from the server pov if the correct response isnt received or you cant verify who the connection is you disconnect/drop it
'g'
|
|
|
|
|
I'd also add, that writing these things from scratch is challenging/rewarding/time consuming, but if you're doing it commercially, you'd almost certainly be better off using a known/supportable framework, like ACE, ICE or such to manage the low level stuff, while you concentrate on the higher level functions
'g'
|
|
|
|
|
Garth,
These last three posts you made are also helping to guide me in the right direction.
On the same note, concerning pre-made libraries, what are your thoughts on ASIO? This seems pretty close, but I haven't had a lot of time to fool with it lately. Have you had a chance to use it, and does that seem a suitable start for me?
Thanks again,
Michael
|
|
|
|
|
unfortunately I havnt had a chance to use it, although I am aware of its existence - needing boost, VC 7.1 or above is the kicker for me, we're still a MSVC6 shop
(Its likely I could get it to run on MSVC6, since the functionality from boost is contained headers, and if it doesnt use 'partial templates' it would depend on how much time I had) - this doesnt answer your question though ...
its got some good things going for it - been around a while, seems relatively stable, IPV6 support, the model seems relatively easy to understand - when it comes down to it, those are the tradeoffs I consider. Of course, we must each weigh up 'ease of use' according to our own background and knowledge, but there seems to be enough examples etc the only kicker which I havnt examined it for is how complex a server can one write with it - number of connection, event model etc - it seems suitable for 'small' client/servers though
|
|
|
|
|
|
Hello.
I'm trying to download a whole sequence od pictures, which are stored on this location:
http://resources.wizards.com/Magic/Cards/LRW/EN/
Now, this map is restricred, but if you enter a specific image url, like
http://resources.wizards.com/Magic/Cards/LRW/EN/Card143370.jpg
you'll be able to download the image!
Images are not named in order, from 000001 to 999999, but my guess is that this six digit number serves as a protection, from what I'm trying to do.
Anyways, I wanted to write a c++ program wich uses 'system()' function to pass a command to cmd, which than opens wget. I need to pass a parameter with that - a parameter that will be changed 999999 times and called 999999 times again and again. I tried to use this code, but wget just does not 'get it'
char temp[512];<br />
sprintf(temp, "wget %s ", parameter);<br />
system((char *)temp);
Now, output to cmd of this is
wget http://resources.wizards.com/Magic/Cards/LRW/EN/Card143370.jpg
and it magicaly runs wget! But...the parameter it gets, understands is (null) for some reason!
I've used all my knowledge, read alot of forum posts, references...no answers, tough I lerned alot
Thanks,
Gregor
|
|
|
|
|
Member 4287390 wrote: it magicaly runs wget! But...the parameter it gets, understands is (null) for some reason!
What do you mean by that? What is null?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well, it runs it like this (copied literaly):
C:\Users\Gregor\Downloads>"MTG picture downloader"
Start
wget http://resources.wizards.com/Magic/Cards/LRW/EN/Card143370.jpg--00:27:41--
http://(null)/
=> `index.html.1'
Resolving (null)... failed: Unknown host.
End
C:\Users\Gregor\Downloads>
start and end are somthing I poped in the program, and I have no idea how null gets there...just a wild guess: wget's default, I'm going to chek wget manual now.
Update: null is not mentioned anywhere in wget manual! Is there any other way to call wget with parameters-.-?
modified on Saturday, February 9, 2008 6:37 PM
|
|
|
|
|
hmm I don't know anything about wget s I can only hopefully help
with the C(++) side of things...
What's the stuff tacked on to the end of the command line
("-00:27:41--...") ???
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Until you verify that both parameter and temp are correct, forget about calling system() .
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How to create controls at runtime in VC++?
Is there any good article for this?
Best Regards,
Suman
|
|
|
|
|
Search the class in MSDN and read Overview or Remarks sections. It describes how to create each control on the fly.
// "In the end it's a little boy expressing himself." Yanni
while (I_am_alive) { cout<<"I love programming."; }
|
|
|
|
|
Hi Thanks for the help..
I got some idea here
Thanks & Regards,
Suman
|
|
|
|
|
What kind of controls? Windows controls?
Using MFC or straight Win32 APIs?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I want to create controls like button, list box, edit etc.. in runtime using MFC
Thanks & Regards,
Suman
|
|
|
|
|
Controls are windows, so they are created the same as any
other window, except they have predefined window classes.
In MFC, windows are created in two steps and destroyed in
two steps - one step for the C++ object (an object derived
from CWnd), and one step for the Windows object (the HWND).
CListBox m_MyListBox;
...
m_MyListBox.Create(WS_CHILD | WS_VISIBLE | LBS_STANDARD, CRect(10,10,100,40), this, ID_MYLISTBOXID);
My favorite reference for controls is the Control Library in MSDN[^]
The MFC docs have the MFC-specific info for the various control wrapper classes.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
For each control we have a class for it like CButton,CListBox,.. you can declare a variable of that class or derived your class of it and then make runtime control.
|
|
|
|
|
hello everyone,
i need to call my coding in C++ to mathlab..i have read some materials for it but i still couldnt get a clear view.really dont know how to start it..hope you all can guide me..thank you.
|
|
|
|
|
|
|
If I correctly understand. you would like to use your VC++ code from within Matlab. Right?
A solution is to turn your VC++ code into mex files. The benefit is that this will speed up the execution within matlab.
I know there is a tool called MexWizard. Have a look at www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=1368&objectType=file
Hope that answers to your question.
regards
|
|
|
|
|