|
|
The previous post is correct. Are you, perhaps, referring to the send and receive buffer sizes instead? That would reflect the largest "chunk" size that could be sent or received by the server and client.
If you're really referring to line speed then there's not a lot you can influence merely by using sockets or not.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
I have a problem here with an exception.
<br />
try<br />
{<br />
... some code ...<br />
Exception appears here<br />
}<br />
catch(Exception ex)<br />
{<br />
... some code ...<br />
(go back into try block, but how ?)<br />
}<br />
After exception was thrown, application should continue code processing in the try block. Is it possible to avoid processing a special error with given error number ? Otherwise, code processing will be interrupted and application close this process.
|
|
|
|
|
you can try the following
public void HandleException( Exception ex )
{
... Do something, as in old catch ...
... some code ...
}
try
{
... some code ...
try
{
// Where exception appears
}
catch(Exception ex)
{
HandleException( ex )
}
}
catch(Exception ex)
{
HandleException( Exception ex )
}
CodeMadness - Code before you go mad!
|
|
|
|
|
Seraphin wrote:
application should continue code processing in the try block
Make your try blocks smaller.
So if you have
try
{
}
catch(Exception ex)
{
} Change it to:
try
{
}
catch(Exception ex)
{
}
try
{
}
catch(Exception ex)
{
}
try
{
}
catch(Exception ex)
{
}
Or a better solution would be to refactor your code so that item 1, item 2 and item 3 individual private methods that get called, each of which has their own try/catch block.
Does this help?
Cada uno es artifice de su ventura
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
|
A perfect example of when/why goto should NEVER be used! I haven't used GOTO since, what, 1992?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Wow. I can't believe you would seriously suggest someone use this. Part of the advantage of methods written in a language like C, C++ or C# is that they are by nature "fall-through". No artificial flow interruptions, reroutes, twists, turns or gyrations are advised (such as "goto", "gosub" etc.).
This kind of coding reflects poor planning, not good practice. It looks like a (bad) piece of VB 6 code.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Maybe you should use IlDecompiler and look at the IL generated from some of your nice 'fall through' c# code. I think you'll find it is liberally sprinkled with goto's. The closer you get to the machine, the more useful and sensible goto gets to be.
what is gosub other than a void method call? is goto really any different than
if(true)<br />
...<br />
else<br />
...
I would agree that if-else is preferable for clatity: the brace blocks are clearer than a lable, but the result is no different: code branches to a new location under some conditions.
In leppies example, if there were multiple try-catch blocks in the same function, a goto and a common cleanup code block would be preferable for maintainability to repeating the code in each catch block...
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
I was commenting on the code example provided. In the example, if an error is generated after the RESTART label, the code will loop indefinitely. That, to me, was a perfect example of why not to use the goto. It leads to bad code.
I'm not disputing whether IL contains goto calls. I am contending that at the time the IL is compiled, there are no nonsensical looping calls made if the developer has constrained him/herself to using the fall-through code style.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
turbochimp wrote:
This kind of coding reflects poor planning, not good practice.
I beg to differ. Show me more readable code, sure you wrap a while around it, or some other way. The fact is goto is clean and simple, and it gives you much better flow control that you can perform via a for/while/etc.
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots
|
|
|
|
|
Until you find a sub with about 20-30 of them in it, then it's just damn ugly and completely unreadable.
Much better flow control? I'd say much more "quick and dirty" flow control. Seriously, I haven't used a single Goto in the last 13 years...
Sure, if you get down to the IL that the compiler generates, yes, you'll find Goto's, or more acurately, Jump's, all over the place. This will happen in lower level languages, but in higher level languages, C# or VB.NET or whatever, using Goto's is an extinct practice, found only in the code of 1st year students.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am inclined to agree with you, since I can't recall needing to use a Goto in a very long time (other than in VB6 of course, where it is mandated by the crude error handling). Goto is rather the flow control of last resort, and will stay around in even high level languages for that last ditch "damn, now what?" situation that once in a very rare while crops up in even the best designed code...
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Um...okay...
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Hi All,
i have got a problem by getting data from an oracle column. The column contains 250 binary values in a single column ( VARCHAR2(250) )!
Each tries to get the byte to a byte array or into a string where not successful!
Just with object I could read something, just one letter and at least its wrong I think.
Thats my Source Code, ...
public static void Main(string[] args)
{
string constr = "Provider=msdaora; Data Source=***; USER ID=***; Password=***";
OleDbConnection myConnection = new OleDbConnection(constr);
string qry = "SELECT * FROM ruest_teach WHERE RT_RK_MODELL_NR= 'W202 M753 13' AND RT_RK_ORGE_NR = 591";
OleDbCommand myCommand = new OleDbCommand(qry,myConnection);
myConnection.Open();
//*** SELECT Operation ausführen lassen
OleDbDataReader myReader = myCommand.ExecuteReader();
string b = "";
int a = 0;
object c = new object();
while (myReader.Read())
{
a = Convert.ToInt32(myReader.GetDouble(0));
b = myReader.GetString(1);
c = myReader.GetOrdinal("RT_TEACH_H");
}
Console.WriteLine(a + " , " + b + " , |" + c + "|");
}
Maybe someone here can help me with my problem. It is really important, because it is part of my examination to get a programmers license in germany.
regards,
eXi
|
|
|
|
|
Hi all,
I try to using c# and programming the CEMAPI(by using VC++) in pocket pc 2003 to retrieve
the emails from the pocket pc. But after several days trials, I still
can't get the receipent and the body of the emails(I can only retrieve
the subject of the emails). Do anyone have the same experience as me ? I
just wonder there are system bugs in the pocket pc MAPI.
Thanks
|
|
|
|
|
I want to get the path to the executable file of a service
(from another app) via the servicecontroller class.
This will enable me to find the config file of the service
and modify this from another app.
How do I do that?
|
|
|
|
|
Hai ,
Iam having following fields.
name
exp
dob
primary
sec skills
ph
email
passport
location
i wnt these things to be added to my db
i wnt add btn , del btn , update btn
sql server , c#
KINDLY SEND ME
chand
|
|
|
|
|
Yikes.
Try googling for "SQL", "ADO", "ODBC". In that order.
And stop shouting.
Cheers
Sid
|
|
|
|
|
|
I totally missed the fact that he might actually mean the "MS SQLServer"
I thought he was referring to "a SQL Server" (in general)
Cheers
Sid
|
|
|
|
|
You have been posting this (and similar) questions every few hours for the past few days, you have not recieved any meaningful replies - does this not tell you anything?
Here, let me give you some pointers.
1) It is understood that English may not be your first language, but if you understand it well enough to abbreviate almost every word then surely you can make an attempt to write the word in full. Dont worry about the odd spelling mistake as Im sure most people can work around them - but having to decipher txt-spk is just a pain in the butt.
2) Asking for fully written code just is not going happen, you must attempt these things yourself using articles/books/documentation, and when you hit a specific proplem then come and ask about that problem. Dont expect somebody to do this for you for free.
3) Please do not ask for answers to be mailed directly to you, this board and every other technical forum, is there for everybody to learn from.
|
|
|
|
|
Hi,
You can connect to the database and do all these operations using Connection, Command, DataReader, DataAdapter classes.
SqlConnection conn = new SqlConnection();
conn. ConnectionString = ""; //Set the connection parameters
SqlCommand cmd = new SqlCommand("");//pass SQl query
conn.Open(); // Open the connection
cmd.Connection = conn;
SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);//execute the command
Read MSDN for more help.
Thanks
SGS
|
|
|
|
|
hi
How i can get a size of RAM and a speed of prossesor by C++ (borland) ?
|
|
|
|
|
|