Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void cocks()
- {
- NetworkStream stream = null;
- try{
- stream = YOUR_TCPCLIENT_HANDLE.GetStream()
- //all of your code here
- }catch(Exception ex){
- //exception raised
- //handle/print how you'd like to with ex.message and ex.innerexception
- }finally{
- //we close all streams regardless of code execution
- if(!YOUR_TCPCLIENT_HANDLE.Equals(null)) YOUR_TCPCLIENT_HANDLE.close();
- if(!stream.Equals(null)) stream.Close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement