Click here to Skip to main content
16,005,206 members
Home / Discussions / C#
   

C#

 
Generalpinvoke full list of functions in c# Pin
Philip Fitzsimons8-Jan-05 5:02
Philip Fitzsimons8-Jan-05 5:02 
GeneralRe: pinvoke full list of functions in c# Pin
Alex Korchemniy8-Jan-05 5:54
Alex Korchemniy8-Jan-05 5:54 
Generalsetup wizard Pin
Boniolopez8-Jan-05 4:49
Boniolopez8-Jan-05 4:49 
GeneralHelp on AlternatingBackColor Pin
monn8-Jan-05 2:13
monn8-Jan-05 2:13 
GeneralRe: Help on AlternatingBackColor Pin
Robert Rohde8-Jan-05 7:02
Robert Rohde8-Jan-05 7:02 
GeneralWEB services Pin
MoustafaS8-Jan-05 1:22
MoustafaS8-Jan-05 1:22 
GeneralRe: WEB services Pin
Rein Hillmann8-Jan-05 6:04
Rein Hillmann8-Jan-05 6:04 
GeneralGet the Stream Pin
Snowjim8-Jan-05 1:16
Snowjim8-Jan-05 1:16 
Hey

I am Working on a Server/Client application in Asynchronous mode. I am using simple Socket when Asynchronous dont simes to be suported by TcpClient och TcpListener.

I am using Serializable on some objects(in a DLL file) to be abled to send this objects easy between the Server and Client, by this i dont want to work with a byte buffer, insted i want somthing like this.

<br />
stream = socket.GetStream();				<br />
//Send Client Info<br />
formatter.Serialize(stream,user);<br />
//Send Client Pass			formatter.Serialize(stream,password);<br />


There i easely can get the objects(if there is any in the stream. Tha abow code is not with a regular socket but a TcpClient.

Right now my Program looks like this
<br />
private void SetupRecieveCallback(Socket server)<br />
{<br />
	try<br />
	{<br />
		if(server != null)<br />
		{<br />
         		AsyncCallback recieveData = new   AsyncCallback(OnRecievedData);<br />
<br />
<br />
                        //I DONT WANT TO USE THIS BUFFERT			          server.BeginReceive(m_byBuffer,0,m_byBuffer.Length,SocketFlags.None,recieveData, server);<br />
		}<br />
	}<br />
	catch(Exception ex)<br />
	{			   MessageBox.Show("Error in ForumClient - Connection - SetupRecieveCallback : " + ex.Message);<br />
	}<br />
}<br />
<br />
<br />
public void OnRecievedData(IAsyncResult ar)<br />
{<br />
	Socket server = (Socket)ar.AsyncState;<br />
	try<br />
	{<br />
		int nbyte<br />
	}<br />
	catch(Exception ex)<br />
	{<br />
		MessageBox.Show("Error in ForumClient - Connection - OnRecievedData : " + ex.Message);<br />
	}<br />
}<br />


How do i get the stream from the socket? and how do i implement it in my program ?

//SnowJim
GeneralRe: Get the Stream Pin
Snowjim8-Jan-05 4:57
Snowjim8-Jan-05 4:57 
GeneralZoom In and Out in PictureBox Windows forms control Pin
AVaka7-Jan-05 23:21
AVaka7-Jan-05 23:21 
GeneralRe: Zoom In and Out in PictureBox Windows forms control Pin
Alex Korchemniy8-Jan-05 5:42
Alex Korchemniy8-Jan-05 5:42 
Generalsystem idle Pin
vyki_c7-Jan-05 23:08
vyki_c7-Jan-05 23:08 
GeneralRe: system idle Pin
Robert Rohde8-Jan-05 0:22
Robert Rohde8-Jan-05 0:22 
Generalscrolling of image Pin
montu33777-Jan-05 22:39
montu33777-Jan-05 22:39 
GeneralRe: scrolling of image Pin
MoustafaS8-Jan-05 1:10
MoustafaS8-Jan-05 1:10 
GeneralRe: scrolling of image Pin
Alex Korchemniy8-Jan-05 5:46
Alex Korchemniy8-Jan-05 5:46 
GeneralRe: scrolling of image Pin
montu33779-Jan-05 19:48
montu33779-Jan-05 19:48 
GeneralDouble click and single click on datagrid Pin
steve_rm7-Jan-05 20:47
steve_rm7-Jan-05 20:47 
GeneralRe: Double click and single click on datagrid Pin
Alex Korchemniy8-Jan-05 5:59
Alex Korchemniy8-Jan-05 5:59 
GeneralAsp .net gantt chart control Pin
amalatsliit7-Jan-05 19:27
amalatsliit7-Jan-05 19:27 
GeneralRe: Asp .net gantt chart control Pin
shruPrasad30-Jan-09 0:07
shruPrasad30-Jan-09 0:07 
GeneralTogle acheckbox Pin
picasso27-Jan-05 18:06
picasso27-Jan-05 18:06 
GeneralRe: Togle acheckbox Pin
Matt Gerrans7-Jan-05 20:53
Matt Gerrans7-Jan-05 20:53 
GeneralRe: Togle acheckbox Pin
Luis Alonso Ramos8-Jan-05 12:34
Luis Alonso Ramos8-Jan-05 12:34 
GeneralAnyone know any good resources (besides codeproject :P) that deal with collections for use in custom controls Pin
FocusedWolf7-Jan-05 17:46
FocusedWolf7-Jan-05 17:46 

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.