Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to define public SktClient variable for use in all forms and functions:
C#
Socket SktClient = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Posted
Updated 3-Sep-10 22:28pm
v2

1 solution

Just defind public Socket SktClient globally in your form.

Then whenever/wherever needed, use the SktClient.
Like:
C#
public Socket SktClient ; // defined gloabally

//Now somewhere in form        
  
SktClient = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900