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!
If you just closesocket(yoursocket) you should not need to create a new one.
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
Socket sck = new Socket();
sck.connect( [...] );
[...]
sck.close();
sck = new Socket();
Wrong, Joe. So very...VERY wrong.
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.
Thought he was doing some psuedo-code.
You forgot shutdown() also.
-Matt
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.