Click here to Skip to main content
15,905,233 members
Home / Discussions / C#
   

C#

 
GeneralRe: setup and deployment with MDB files Pin
Member 44190931-Oct-03 6:52
Member 44190931-Oct-03 6:52 
Generalwindows service and SQL related problem Pin
rishikt31-Oct-03 3:50
rishikt31-Oct-03 3:50 
GeneralRe: windows service and SQL related problem Pin
Heath Stewart31-Oct-03 4:42
protectorHeath Stewart31-Oct-03 4:42 
GeneralRe: windows service and SQL related problem Pin
Terry Denham31-Oct-03 5:25
Terry Denham31-Oct-03 5:25 
GeneralRe: windows service and SQL related problem Pin
Blake Coverett31-Oct-03 7:36
Blake Coverett31-Oct-03 7:36 
Generalmulti thread question Pin
rod termaat31-Oct-03 3:38
rod termaat31-Oct-03 3:38 
GeneralRe: multi thread question Pin
Heath Stewart31-Oct-03 4:35
protectorHeath Stewart31-Oct-03 4:35 
GeneralRe: multi thread question Pin
Blake Coverett31-Oct-03 8:04
Blake Coverett31-Oct-03 8:04 
I'll add another vote for the general solution that Heath already sketched out. In addition, here[^] is some sample code to do exactly this which I posted last week in answer to someone else's question.

To answer your other questions:

Yes, you can read and write on the same socket at the same time.

Leave the connection open, a single connection doesn't consume enough resources to care about. You should, however, be prepared to handle connection failures and go back into listening state to wait for the client to reconnect, incase of transient network failure.

No, you don't need to use multiple threads given that you have a single client. (There is an advanced case where it might be useful to use multiple threads with one client, if you want to send your requests to the mainframe asynchronously, i.e. submit a second request before the result of the first one has been recieved. If your transactional performance is already adequate, then don't complicate life by doing that.)

One last pointer, checksums are your friend:
System.Convert.ToBase64String(<br />
System.Security.Cryptography.SHA1.Create().ComputeHash(<br />
System.Text.Encoding.Unicode.GetBytes(yourData)))



-Blake
GeneralCOM Interop - objects cause NullReferenceExceptions at random Pin
Corinna John31-Oct-03 2:39
Corinna John31-Oct-03 2:39 
GeneralRe: COM Interop - objects cause NullReferenceExceptions at random Pin
Heath Stewart31-Oct-03 5:22
protectorHeath Stewart31-Oct-03 5:22 
Generalnoob winform question Pin
R. Thomas31-Oct-03 1:37
R. Thomas31-Oct-03 1:37 
GeneralRe: noob winform question Pin
Daniel Turini31-Oct-03 2:20
Daniel Turini31-Oct-03 2:20 
GeneralRe: noob winform question Pin
R. Thomas31-Oct-03 4:08
R. Thomas31-Oct-03 4:08 
General(null) values in datagrid Pin
misiek31-Oct-03 0:30
misiek31-Oct-03 0:30 
GeneralRe: (null) values in datagrid Pin
Daniel Turini31-Oct-03 2:18
Daniel Turini31-Oct-03 2:18 
GeneralRe: (null) values in datagrid Pin
misiek31-Oct-03 2:59
misiek31-Oct-03 2:59 
GeneralRe: (null) values in datagrid Pin
Braulio Dez31-Oct-03 2:59
Braulio Dez31-Oct-03 2:59 
GeneralCrystal Export to Excel Pin
akorolev1030-Oct-03 20:17
akorolev1030-Oct-03 20:17 
GeneralWritng objects to file Pin
Itanium30-Oct-03 18:34
Itanium30-Oct-03 18:34 
GeneralRe: Writng objects to file Pin
MKlucher30-Oct-03 19:08
MKlucher30-Oct-03 19:08 
GeneralRe: Writing objects to file Pin
Itanium30-Oct-03 19:43
Itanium30-Oct-03 19:43 
GeneralRe: Writng objects to file Pin
Corinna John30-Oct-03 19:50
Corinna John30-Oct-03 19:50 
GeneralRe: Writng objects to file Pin
Itanium30-Oct-03 21:44
Itanium30-Oct-03 21:44 
GeneralCommand Bars Pin
monrobot1330-Oct-03 17:37
monrobot1330-Oct-03 17:37 
GeneralRe: Command Bars Pin
J. Dunlap30-Oct-03 20:59
J. Dunlap30-Oct-03 20:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.