EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Urgent SBSocket.EElSocketError

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#9250
Posted: 03/12/2009 17:58:50
by Aldo G (Basic support level)
Joined: 02/03/2009
Posts: 9

im using vistual studio .net 2003 compact framework i have verify other post but havent find anything that could help

An unhandled exception of type 'SBSocket.EElSocketError' occurred in SecureBlackbox.SSHClient.dll

Additional information: Wrong socket state 0 in CanReceive (error code is 96258)

i have acomplish connection and sending and receveing to the ssh
and in others time this error occurs i need help, anything im doing wrong?

i have this in a method to connect ( my client its a global variable)
i connect several time to the server in different proccess

//this one is for adding the received message
thread = new Thread(newThreadStart(VerifyInfo));
seguir=true;
KeyStorage = new TElSSHMemoryKeyStorage(this);

client.KeyStorage = KeyStorage;

client.Address = randomSSHHostToUse;
client.Port = 22;

client.Username =randomSSHUserToUse;
client.Password = randomSSHPassToUse;
client.Versions = 0;
client.Versions += SBSSHCommon.Unit.sbSSH1;

client.Versions += SBSSHCommon.Unit.sbSSH2;

client.ForceCompression = false;


try
{


client.Open();

}
catch (Exception)
{
//MessageBox.Show("segundo Intento");
client.Address=randomSSHSecondaryHostToUse;
client.Username=randomSSHSecondaryUserToUse;
client.Password=randomSSHSecondaryPassToUse;

try
{
client.Open();
}
catch(Exception ex)
{
throw;
}

}

This is the method i used to send

private void Send(string Data)
{
byte[] encoded =System.Text.Encoding.UTF8.GetBytes(Data
+ "\x0d\x0a");
if(client.Active)
{
client.SendData(encoded, encoded.Length);
}

this is the method i used to receive

private string ReceiveData()
{
byte[] data = new byte[65280];
byte[] dataErr = new byte[65280];
int dataLen, dataErrLen;

dataLen = data.Length;
dataErrLen = dataErr.Length;
if(client.Active)
{
client.ReceiveData(ref data, ref dataLen, ref
dataErr, ref dataErrLen);
return
System.Text.Encoding.UTF8.GetString(data, 0, dataLen);
}
#9254
Posted: 03/12/2009 23:40:52
by Ken Ivanov (EldoS Corp.)

This exception is usually returned if the server suddenly closes the connection.
1) Does it occur with some particular server(s) or with any server?
2) On what exactly stage of the connection does the problem occur? If it is thrown from inside the ElSimpleSSHClient.Open() method, please try following the instructions first.
#9269
Posted: 03/13/2009 09:52:23
by Aldo G (Basic support level)
Joined: 02/03/2009
Posts: 9

well i have located where it happends ,and it happends in the method of receivedData

actually i have another thread that does a loop to get the received data and after while a go out of the loop , i just added a canReceive() condition
and im testing it right now , could this be de problem?

tnx in advance
#9271
Posted: 03/13/2009 10:03:23
by Eugene Mayevski (EldoS Corp.)

The client component should be used within one thread, so using it from several threads will be a problem.


Sincerely yours
Eugene Mayevski
#9274
Posted: 03/13/2009 11:34:52
by Aldo G (Basic support level)
Joined: 02/03/2009
Posts: 9

then instead of the thread receiving the info
can i use a loop of
do{
ReceiveData()
}while(canReceive(500)



or other way to get info becuase when i send the command and wait for some time and then use Receive Data it only gets a part of the message Returned

#9275
Posted: 03/13/2009 11:35:40
by Aldo G (Basic support level)
Joined: 02/03/2009
Posts: 9

i have test it and i think works with the loop thas the right way of doing it ???
#9276
Posted: 03/13/2009 12:25:36
by Eugene Mayevski (EldoS Corp.)

Sorry, I don't understand you.


Sincerely yours
Eugene Mayevski
#9284
Posted: 03/13/2009 16:14:27
by Aldo G (Basic support level)
Joined: 02/03/2009
Posts: 9

its ok tnx for ur time is working now
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

Topic viewed 3492 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!