CFanatic

Go Back   CFanatic > Programming > C# Programming

Join CFanatic Forum Now

Server connection problem topic posted under C# Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 08-30-2010, 06:17 PM
 
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Frederick Lupien is on a distinguished road
| More
Server connection problem

Hi.

I have an client / server application that works perfectly well when the client runs in c#. Problem is that the real client is a PIC microprocessor and we are unable to connect to our C# server using the PIC. Using wireshark to monitor the network packet, it seems that the C# client and the PIC client both send identical SYN packet for the initial connection (we even facked the MAC address at one point to make the packet as identical as possible) but the server ignores them.

Here is the server listening code:

Code:
 	void StartListen()
        {
            try
            {
                // Create the listening socket...
                m_oMainSocket = new Socket(AddressFamily.InterNetwork,
                                          SocketType.Stream,
                                          ProtocolType.Tcp);
                IPEndPoint ipLocal = new IPEndPoint(IPAddress.Any, 5000);
                //m_oMainSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.DontFragment, false);
                // Bind to local IP Address...
                m_oMainSocket.Bind(ipLocal);
                // Start listening...
                m_oMainSocket.Listen(4);
                // Create the callback for any client connections...
                m_oMainSocket.BeginAccept(new AsyncCallback(OnClientConnect), null);

            }
            catch (SocketException se)
            {
                CLog.Log(se.Message);
                System.Diagnostics.Debugger.Break();
            }

        }
Here is the correct packet exchange using the C# client (.140 is the client, .154 is the server)


Code:
179        34.341466        192.168.0.140        192.168.0.154        TCP        58868 > commplex-main [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=2
180        34.341579        MacAddressServer        Broadcast        ARP        Who has 192.168.0.140?  Tell 192.168.0.154
181        34.342439        MacAddressClient        MacAddressServer        ARP        192.168.0.140 is at MacAddressClient
182        34.342447        192.168.0.154        192.168.0.140        TCP        commplex-main > 58868 [SYN, ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1460 WS=8
183        34.342724        192.168.0.140        192.168.0.154        TCP        58868 > commplex-main [ACK] Seq=1 Ack=1 Win=65700 Len=0
And here the single PIC packet the does not trigger the server response. It's the same expect for the frame number, ID and checksum:
Code:
65        15.696625        192.168.0.139        192.168.0.154        TCP        53650 > commplex-main [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=2
I have been working on this all day without any progress. Any help greatly appreciated.

I can post the wireshark complete wireshark log if necessary.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
after validating all the fields in a form how to establish a connection to sql server anitha10 C# Programming 0 08-28-2010 03:11 AM
after validating all the fields in a form how to establish a connection to sql server anitha10 C# Programming 0 08-28-2010 03:11 AM
how to check internet connection Hystrio MFC Programming 1 07-24-2008 11:58 PM
MFC SDI with ODBC Connection gaurav0381 MFC Programming 8 02-26-2008 05:45 AM
connection to server in mfc suresh vaikuntam Introduce yourself 0 09-12-2007 09:08 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 02:19 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board