Closed GoogleCodeExporter closed 8 years ago
This happens because the encoding used between you and hub is different then
encoding
between you and other users.
You need to set encoding on TransferNmdcProtocol to.
Changing on 2 places should probably do the trick.
For active connections:
void trans_ProtocolChange(object sender, FmdcEventArgs e)
{
Transfer trans = sender as Transfer;
if (trans == null)
return;
IProtocolTransfer prot = e as IProtocolTransfer;
if (prot != null)
{
prot.ChangeDownloadItem -= Protocol_ChangeDownloadItem;
prot.RequestTransfer -= Protocol_RequestTransfer;
}
// Set Encoding here
trans.Protocol.ChangeDownloadItem += new
FmdcEventHandler(Protocol_ChangeDownloadItem);
trans.Protocol.RequestTransfer += new
FmdcEventHandler(Protocol_RequestTransfer);
}
For passive connections:
void hubConnection_Update(object sender, FmdcEventArgs e)
{
switch (e.Action)
{
case Actions.TransferRequest:
if (e.Data is TransferRequest)
{
TransferRequest req = (TransferRequest)e.Data;
transferManager.AddTransferReq(req);
}
break;
case Actions.TransferStarted:
Transfer trans = e.Data as Transfer;
if (trans != null)
{
// Set Encoding here
transferManager.StartTransfer(trans);
}
break;
}
}
(Remember that you should only do this if the protocol is of type
TransferNmdcProtocol)
Please let me know how it goes.
Original comment by blomman84
on 19 Feb 2009 at 9:19
Now it works fine. Thank you very much!
Original comment by hackw...@gmail.com
on 24 Feb 2009 at 7:51
Good. Issue closed :)
Original comment by blomman84
on 24 Feb 2009 at 11:24
Original issue reported on code.google.com by
hackw...@gmail.com
on 17 Feb 2009 at 5:11