Originally posted by: Ray
Do you have any idea how to tweak this so that the socket could be reused such that the same client could connect infinitely on one server run? Any help would be much appreciated, i tried fiddling with the assertions but that basically ended up with throwing exceptions instead of assertion crashes, due to the condition of the socket.
If i could get past this, i could continue coding my MUD!!
p.s yes i am the same guy that mailed you but i used an address off of codeproject.com and saw through google that you posted here recently so i figured i may as well :-)
Thanks again,
Basically, if you connect to the server (or localhost), type quit, which disconnects you., and then reconnect and try to send data, like typing a message that relays to the Chat function, an assertion fails and the server crashes. The assertion says something about the m_hSocket != NULL failing.
Ray O'Neill
Originally posted by: Johan
The game say that you have to make a game with:
'create name' with name = name of the game
when you do this you get an error.
it should be:
'create chess name' with name = name of the game.
---------------------------------------------------
But hte program is very good.
Great!
and thanks.
Gr Johan
ReplyOriginally posted by: Samantha
I'm unable to use socket->Connect() in my thread. There's no compilation error but the socket is unable to Recv()
My code is as follows, any idea?
//variable
CSocket *m_pSocket=NULL;
main function
UINT ThreadFunc (LPVOID pParam)
//unable to psockListen->Connect("192.156.1.1", 23 );
psockListen->Receive(buf,BUFSIZE, 0 );
psockListen->Send("test\r\n",strlen("test\r\n"), 0 );
}
Is it possible to use the CSocket function Create() n Connect() in a thread?
and Send() if I add the socket->Connect() in my thread.
thanxs!
typedef struct tagTHREADPARMS {
CSocket *sock;
} THREADPARMS;
{
............
THREADPARMS* ptp = new THREADPARMS;
m_pSocket = new CSocket;
m_pSocket->Create()
m_pSocket->Connect("192.168.1.1", 23)
ptp->sock=m_pSocket;
AfxBeginThread (ThreadFunc, ptp);
}
{
THREADPARMS* ptp = (THREADPARMS*) pParam;
CSocket* psockListen=(CSocket*)ptp->sock;
delete ptp;
Originally posted by: Stefan
Please Help me!!!!
I lunch server.exe.
I lunch cmd.exe
---> telnet localhost
---> enter your login name<only "guest" works>:
---> guest
server tell me "TalkProc Start"
---> Type "create name"...
---> Type "join name"...
---> Type "watch game"...
create chess | stefan
"Created new chess game"
"you must now wait till someoane join your game"
server tell me :
"Pending Games"
"TalkProc End"
than I lunch another cmd.exe
I made all the same steps:
---> telnet localhost
---> enter your login name<only "guest" works>:
---> guest
---> Type "create name"...
---> Type "join name"...
---> Type "watch game"...
server tell me :
Connection accepted
"TalkProc Start"
"Find Pending Game"
join stefan
and error "no game found"
WERE I MADE A MISTAKE??????
Originally posted by: Troels
Straight MFC telnet server implementation here:
http://home.worldonline.dk/~troels_k/code
Reply
Originally posted by: Eruanno
Ok, see, I fixed the little typo for the llist.h file. Now, it says as an error that _beginthread and _endthread are undeclared identifier.
BTW: I'm using MSVC++ 6.0.
process.h is included, but, for some reason, it doesn't declare it or something....
ReplyOriginally posted by: Robert van Drunen
Hi,
First I would like to say that this is indeed great, I only have one problem:
I am trying to convert the program so that it functions as an NT Service. But when I try to compile it I get an error stating:
_beginthread' : cannot convert parameter 1 from 'void (void *)' to 'void (__cdecl *)(void *)
What can cause this? Does anybody know it, or how I can avoid it?
Reply
Originally posted by: Chris Wilson
I think there is a minor problem with freeing memory from TelnetSocket::~CTelnetSocket(). I place a breakpoint in that destruct and seems that code never gets executed.
// New Line
Thanks,
You did a great job on the app.
I believe the problem is in main(). It should look like this:
void main(void)
{
// This should be CTelnetSocket
// CBlockingSocket sockListen;
CTelnetSocket sockListen;
... rest of code
Chris
Originally posted by: Javier Quiroz
Hi people:
I am writing in my first Winsock project. The task I have to undertake is not an easy one for a newcomer (at least I think so). I need to write a server program that installs itself as a service. Any ideas, references or hints on how to do this? I have managed to create a basic service on NT (easy task) the part that is causing me trouble is doing the winsock dispatching the messages to the windows message handler procedure.
I have already done my Winsock server that works fine but displays a window. Obviously that is unacceptable for a service that will not have any window associated.
Thanks in advance.
ReplyOriginally posted by: xzyeena
If my server is running on one machine and I want to telnet from another,How Do I do that ?