User Profile

Collapse

Profile Sidebar

Collapse
moii
moii
Last Activity: May 25 '14, 04:03 PM
Joined: May 25 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • moii
    replied to multi client to server in C#
    Don't forget this for client :

    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    using System.Net;
    using System.Net.Sockets;
    See more | Go to post
    Last edited by Rabbit; May 25 '14, 09:23 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.

    Leave a comment:


  • moii
    replied to multi client to server in C#
    Code:
    namespace Client
    {
    	public partial class ClientForm : Form
    	{
    		const int BUFFER_SIZE = 1024;
    		byte[] sendBuffer = new byte[BUFFER_SIZE];
    
    		byte[] rcvBuffer = new byte[BUFFER_SIZE];
    		Socket clientSocket;
    		const int PORT = 3333;
    
    		public ClientForm()
    		{
    			InitializeComponent();
    		}
    
    		void btnConnect_Click(object sender, EventArgs e)
    		{
    ...
    See more | Go to post
    Last edited by Rabbit; May 25 '14, 09:22 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.

    Leave a comment:


  • moii
    replied to multi client to server in C#
    this is the client code ! You can try it .
    See more | Go to post

    Leave a comment:


  • moii
    replied to multi client to server in C#
    Code:
    void AcceptCallback(IAsyncResult AR)
    		{
    			try
    			{
    				Socket tempSocket = serverSocket.EndAccept(AR);	// Client connected successfully, waiting for requests
    
    				tempSocket.BeginReceive(rcvBuffer, 0, rcvBuffer.Length, SocketFlags.None, ReceiveCallback, tempSocket);
    
    				socketCounter++;
    				clientSocketDictionary.Add(tempSocket, socketCounter);
    
    				AppendToTextBox("Client
    ...
    See more | Go to post
    Last edited by Rabbit; May 25 '14, 09:22 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.

    Leave a comment:


  • moii
    replied to multi client to server in C#
    you must determine the client ip first !
    See more | Go to post

    Leave a comment:


  • moii
    replied to multi client to server in C#
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    using System.Net;
    using System.Net.Sockets;
    using System.Diagnostics;
    
    using System.IO;
    
    namespace Server
    {
    	public partial class ServerForm : Form
    	{
    ...
    See more | Go to post
    Last edited by Rabbit; May 25 '14, 09:22 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.

    Leave a comment:

No activity results to display
Show More
Working...