![]() |
|
#1
|
|||
|
|||
Need Help using socketIm trying to use socket to do a telnet program, the socket works fine the first run of the program, but if I kill the program without doing a close on the socket. I can't get the program to work again untill whenever the socket finally goes away by itself.
It would create the socket but will not connect to it, and im sure its because the socket is already held up, I try doing a setsockopt with SO_REUSEADDR, but still don't work. So guess the question is how can I get the socket to work again if the program exited and I need to start it up again. Thanks. |
|
#2
|
|||
|
|||
Re: Need Help using socketQuote:
Show some code. I can't see much point in our trying to guess what you actually tried. You might also mention what operating system and what compiler you are using. Although most of the sockets functions are supposedly specified (more-or-less) by the POSIX standard there are many variations that exist in the wild, and none of them is a part of the C standard library. Details vary with different implementations (different compilers; different operating systems, different etc.). Regards, Dave |
|
#3
|
|||
|
|||
Re: Need Help using socketThis is for c++ Greenhill INTEGRITY environment.
Just your basic create and connect command... This program is downloaded from somewhere else. CPP / C++ / C Code:
The problem is when I get the telnet session running and if I decided to just close the gui without going through the proper log off, the next time I try to run the program again it just hang in the connect command, im guessing its because the socket is not close. I guess I just need a exception handling to that it close the socket before it exit, but how would you handle that if the user just close the gui application? |
|
#4
|
|||
|
|||
Re: Need Help using socketQuote:
Quote:
Quote:
I assume you are implementing a telnet client with the class you showed. Have you tried a very simple main() (a console application)? CPP / C++ / C Code:
Start the server. Start the client. Hit 'Enter' and start the client again. Repeat. Start the client. Hit ctrl-C instead of Enter. Repeat. Do various sequences of ctrl-C, Enter from the client. You might also tell us what operating system and what telnet server you are using. If any of my assumptions are incorrect, then maybe you can give us a few more clues. Regards, Dave |
Recent GIDBlog
Developing GUIs with wxPython (Part 2) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux Socket send() maximum size | Mofix | C Programming Language | 4 | 26-Mar-2007 12:41 |
| [PROGRAM] Winsock Programming | Max Payne | MS Visual C++ / MFC Forum | 1 | 08-Mar-2007 23:38 |
| Reading socket input streams. | AJSHOPE | C++ Forum | 2 | 21-May-2006 16:42 |
| windows sockets confusion | ubergeek | C++ Forum | 1 | 18-Jul-2005 20:44 |
| Child Thread fails to update Shared Memory Correctly | j_kenpo | C++ Forum | 1 | 12-Jul-2005 17:06 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The