• Welcome to Valhalla Legends Archive.
 

Reconnecting a Socket

Started by Spilled, September 04, 2006, 10:33 PM

Previous topic - Next topic

Spilled

Hi I'm having a problem reconnecting my Socket so I did some reading and was wondering if someone could clear some stuff up for me. While i was reading it said that once you connect a SOCKET and Close it you must create a new one. So how would I Do this and keep the Socket global so I can use it throughout the program? Can anyone clear this up? Thanks in advance!

UserLoser

If you just closesocket(yoursocket) you should not need to create a new one.

Win32

If you're refering to using a streaming socket more than once to create a connection, then you cannot using berkley sockets. You can though using the Window's Winsock extension functions.


-Matt

Joe[x86]

Socket sck = new Socket();
sck.connect( [...] );
[...]
sck.close();
sck = new Socket();
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

rabbit

Wrong, Joe.  So very...VERY wrong.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

MyndFyre

Quote from: Joex86] link=topic=15633.msg157674#msg157674 date=1157716140]
Socket sck = new Socket();
sck.connect( [...] );
[...]
sck.close();
sck = new Socket();
That's Java or something.  We're in the C++ forum.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Win32

Thought he was doing some psuedo-code.
You forgot shutdown() also.


-Matt

Joe[x86]

I know what forum we're in, although I guess I don't know the language I'm talking about. :).

Anyhow, what I meant to do was assign the reference to point to a new object.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.