[Vortex] vortex_channel_send_ans_rpy() is failing duringMSG/ANSpattern
Yourch, Chris
chris at replicus.com
Sat Oct 13 04:23:24 CEST 2007
I forgot to add the frame handler, where the error is occurring.
CFile infile = openFile();
while (true)
{
m_fileChunkLength = infile.Read(m_fileChunk,
sizeof(m_fileChunk));
if (m_fileChunkLength == 0)
break;
m_nextOffset += m_fileChunkLength; // Update the offset to the
place we will read from on the next call.
// Tell the derived class (us!) to write its member data to the
given byte stream.
DWORD response_buffer_length;
void *response_buffer_ptr = MessageToByteStream(response_stream,
response_buffer_length);
// *** ERROR occuring here ***
// Keep sending ANS frames as long as we have more data to send.
if (vortex_channel_send_ans_rpy(m_channel, (const char
*)response_buffer_ptr, response_buffer_length, m_msgno))
{
CMainDlg::AddLogMsg(MsgType_error,
MyStr::Format(L"CMsgPullFile::OnMessageReceived():
vortex_channel_send_ans_rpy(channel = %d, msgno = %d) succeeded in
sending offset %I64u of %I64u bytes.",
vortex_channel_get_number(m_channel), m_msgno, m_nextOffset,
m_filesize));
}
else
{
const char *conn_status =
vortex_connection_get_message(vortex_channel_get_connection(m_channel));
CMainDlg::AddLogMsg(MsgType_error,
MyStr::Format(L"CMsgPullFile::OnMessageReceived():
vortex_channel_send_ans_rpy(channel = %d, msgno = %d) failed to send
offset %I64u. (%s)", vortex_channel_get_number(m_channel), m_msgno,
m_nextOffset, CStringW(conn_status)));
}
}
infile.Close();
vortex_channel_finalize_ans_rpy(channel, msgno);
-----Original Message-----
From: vortex-bounces at lists.aspl.es [mailto:vortex-bounces at lists.aspl.es]
On Behalf Of Yourch, Chris
Sent: Friday, October 12, 2007 7:09 PM
To: vortex at lists.aspl.es
Subject: Re: [Vortex] vortex_channel_send_ans_rpy() is failing
duringMSG/ANSpattern
For some more detail, here's my stripped down code:
vortex_listener_new("0.0.0.0", szPort, NULL, this);
// frames received here
vortex_listener_set_on_connection_accepted(server_on_accepted, this);
VortexConnection *connection = vortex_connection_new(pszHost, szPort,
NULL, NULL);
if (vortex_connection_is_ok(connection, false))
{
channel_pool = vortex_channel_pool_new(connection,
CELL_PROFILE_URI,
1,
channel_pool_close_channel, this,
NULL, NULL,
NULL, NULL);
VortexChannel *channel =
vortex_channel_pool_get_next_ready(channel_pool, true);
vortex_channel_set_received_handler(channel,
channel_pool_frame_received, user_data);
int msg_no;
vortex_channel_send_msg(channel, (const char
*)output_buffer_ptr,
output_buffer_length, &msg_no);
}
-----Original Message-----
From: vortex-bounces at lists.aspl.es [mailto:vortex-bounces at lists.aspl.es]
On Behalf Of Yourch, Chris
Sent: Friday, October 12, 2007 4:58 PM
To: vortex at lists.aspl.es
Subject: [Vortex] vortex_channel_send_ans_rpy() is failing during
MSG/ANSpattern
In my frame handler I get a message and then proceed, in a loop, to send
a bunch of reply frames via vortex_channel_send_ans_rpy(). The frames
are about 4k in size. vortex_channel_send_ans_rpy() fails with the
vortex_connection_get_message() of "client have disconnected without
closing session". I know that I have not called any disconnect methods
on the client end so I am confused as to why I get this error message.
What could be going on? I am also using channel pools to get my channel
and that is succeeding on client end.
Thanks!
Chris
_______________________________________________
Vortex mailing list
Vortex at lists.aspl.es
http://lists.aspl.es/cgi-bin/mailman/listinfo/vortex
_______________________________________________
Vortex mailing list
Vortex at lists.aspl.es
http://lists.aspl.es/cgi-bin/mailman/listinfo/vortex
More information about the Vortex
mailing list