Click here to Skip to main content
15,919,358 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Non-static method as a thread function....How CLR do that? Pin
Secret_Garden7-Apr-08 6:02
Secret_Garden7-Apr-08 6:02 
QuestionIntegration with IPLANET throw LDAP Pin
arajeh7-Apr-08 2:12
arajeh7-Apr-08 2:12 
GeneralClickOnce and https Pin
l.m.k7-Apr-08 0:37
l.m.k7-Apr-08 0:37 
AnswerRe: ClickOnce and https Pin
Arjun Marwaha13-Apr-08 19:36
Arjun Marwaha13-Apr-08 19:36 
GeneralConnecting a client and server program using .NET framework but different source code Pin
Kogee San6-Apr-08 14:56
Kogee San6-Apr-08 14:56 
GeneralRe: Connecting a client and server program using .NET framework but different source code Pin
Mark Salsbery6-Apr-08 17:04
Mark Salsbery6-Apr-08 17:04 
GeneralRe: Connecting a client and server program using .NET framework but different source code Pin
Kogee San6-Apr-08 17:26
Kogee San6-Apr-08 17:26 
GeneralRe: Connecting a client and server program using .NET framework but different source code Pin
Mark Salsbery6-Apr-08 17:44
Mark Salsbery6-Apr-08 17:44 
Kogee San wrote:
I just want to know is there any method or code which can connect a client programmed in C to a server which is programmed in C#


TCP/IP is TCP/IP, no matter what platform it runs on or what language the code is written in.

Why do you dismiss error codes?  They can give you important clues to reasons for failure.
That's why they are there.  Why not use the clues the system offers? Otherwise all you can do is guess.

Using the socket APIs properly will help...

First you need the port number in network byte order:

receiver.sin_port = <span style="font-weight: bold;">htons(5000)</span>;

Then you need to properly check for errors:

  status = connect(sock, (struct sockaddr *)&receiver, sizeof(struct sockaddr));<br />
<br />
if (<span style="font-weight: bold;">SOCKET_ERROR</span> == status)<br />
{<br />
    
printf("Cannot connect to server, error no %d occured\n", ::WSAGetLastError());
<br />
}<br />


Mark




Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Connecting a client and server program using .NET framework but different source code Pin
Kogee San6-Apr-08 18:58
Kogee San6-Apr-08 18:58 
Generaltimer Pin
cheikhanio5-Apr-08 13:14
cheikhanio5-Apr-08 13:14 
GeneralRe: timer Pin
Luc Pattyn5-Apr-08 14:31
sitebuilderLuc Pattyn5-Apr-08 14:31 
GeneralInstaller not found Pin
Codename474-Apr-08 0:30
Codename474-Apr-08 0:30 
GeneralRe: Installer not found Pin
#realJSOP4-Apr-08 3:01
professional#realJSOP4-Apr-08 3:01 
GeneralRe: Installer not found Pin
Codename474-Apr-08 3:39
Codename474-Apr-08 3:39 
GeneralAdding column to a typed dataset Pin
Vipul Mehta3-Apr-08 19:39
Vipul Mehta3-Apr-08 19:39 
GeneralMemory Consumption Question Pin
#realJSOP3-Apr-08 14:00
professional#realJSOP3-Apr-08 14:00 
GeneralRe: Memory Consumption Question Pin
Mark Salsbery3-Apr-08 14:15
Mark Salsbery3-Apr-08 14:15 
GeneralRe: Memory Consumption Question Pin
#realJSOP4-Apr-08 0:15
professional#realJSOP4-Apr-08 0:15 
GeneralRe: Memory Consumption Question Pin
Luc Pattyn4-Apr-08 1:11
sitebuilderLuc Pattyn4-Apr-08 1:11 
GeneralRe: Memory Consumption Question Pin
Mark Salsbery4-Apr-08 6:42
Mark Salsbery4-Apr-08 6:42 
GeneralRe: Memory Consumption Question Pin
Pete O'Hanlon4-Apr-08 1:26
mvePete O'Hanlon4-Apr-08 1:26 
GeneralRe: Memory Consumption Question Pin
#realJSOP4-Apr-08 2:44
professional#realJSOP4-Apr-08 2:44 
GeneralRe: Memory Consumption Question Pin
Pete O'Hanlon4-Apr-08 8:44
mvePete O'Hanlon4-Apr-08 8:44 
GeneralRe: Memory Consumption Question Pin
Zoltan Balazs4-Apr-08 11:33
Zoltan Balazs4-Apr-08 11:33 
GeneralRe: Memory Consumption Question Pin
Patrick Etc.7-Apr-08 11:44
Patrick Etc.7-Apr-08 11:44 

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.