Skip to main content
gamedev.net
🔒 Locked

Twisted Client Server interaction

Started by PhlashStudios 2 replies 1k views
Original Post
PhlashStudios
PhlashStudios
Hi, I am working in Python and using the twisted libray, as well as using C++ and visual studio 2003. I am writing a server in python and twisted, and creating a client to connect to that server in C++. Right now the server is pretty functional with a telnet application as well as a test client written in python, but the C++ client has proven to be more difficult. Right now, it can connect, and receive messages from the server fine, the problem is sending messages to the server. Right now what my program does, is it takes the string that is supposed to be sent to the server, and appends a /r/n to the end,so the server knows that thats the end of the line (a requirement in twisted). It then sends it off. But right now the server does not registered that it received it. Does anyone know why that is?
<a href="http://eyeredux.com/campaigns/1/redirect">Hello!</a>
Kylotan
Kylotan
You would have to give a lot more detail than that, unfortunately. Is the data definitely getting sent? Is it getting to the other side? You can test that with a very simple listening socket script. How are you altering that string before you send it?
PhlashStudios
PhlashStudios
Should I post the serverside and the clientside code?
Quote:
How are you altering that string before you send it?

I am altering the string that is supposed to be sent, by sending the string to a function that appends "/r/n" to the end of it so that the server knows its a new line. The function then sends its.
<a href="http://eyeredux.com/campaigns/1/redirect">Hello!</a>
Kylotan
Kylotan
I expect the code is too long to post it all.

I know you append the '\r\n', but I meant, what are you actually doing to alter that string? C++ string handling can be tricky depending on the methods you're using. And how exactly are you sending that data?

Does it work if you hardcode messages instead of doing the append to the supplied string?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.