473,414 Members | 1,627 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

binding sockets and pointer types

Hello all.

I wish to bind a socket with the following code:
if (bind(s, (struct sockadrr *) serversocket, sizeof(serversocket)) != 0) {
perror("Failed to bind the server socket to a file.");
exit(1);
};
where serversocket is declared with
struct sockaddr_un serversocket;
At compile-time, I get:
main.c:29: warning: passing argument 2 of ´bind´ from incompatible pointer type.
I do not really understand how to get rid of this warning.

Guillaume.
Jun 21 '07 #1
3 1662
Guillaume Yziquel a écrit :
Hello all.

I wish to bind a socket with the following code:
Oh. I forgot to mention: I'm trying to use Unix-domain sockets, not
TCP/IP sockets. I've been trying to follow what has been written on:

www.ecst.csuchico.edu/~beej/guide/ipc/usock.html

Guillaume.
Jun 21 '07 #2
In article <f5***********@sxnews1.qg.com>,
Guillaume Yziquel <pr********@libre-en-francais.reprivee-francaisewrote:
if (bind(s, (struct sockadrr *) serversocket, sizeof(serversocket)) != 0) {
Assuming this is cut-and-pasted from your program, the problem is that
you have misspelled "sockaddr" as "sockadrr".

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Jun 21 '07 #3
Richard Tobin a écrit :
In article <f5***********@sxnews1.qg.com>,
Guillaume Yziquel <pr********@libre-en-francais.reprivee-francaisewrote:
>if (bind(s, (struct sockadrr *) serversocket, sizeof(serversocket)) != 0) {

Assuming this is cut-and-pasted from your program, the problem is that
you have misspelled "sockaddr" as "sockadrr".
You assumed right. Thank you: that was the last thing I were to think of...

Guillaume.
Jun 21 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port...
14
by: jack | last post by:
At this link I have two c# projects, one is a client, the other is a server. Just point the ip address of the client at the server http://www.slip-angle.com/hosted/bug/ The server does...
3
by: Dennis Chang | last post by:
Hi all, I was reading about function pointers and came across something which intrigued me. K&R2 calls qsort (pg.119) within main as so: qsort( (void **) lineptr, 0, nlines-1, (int (*) (void...
3
by: Raj | last post by:
I want to pass a C structure from a windows server to the C# client using the Sockets. Will there be requirements to cast the data types in the C# client?
3
by: gregory_may | last post by:
I want to prevent late binding of this statement: MyServerConnections(Myindex).client = Value But when I try with the code below, I get an editor error: "Expression is a value and therefor...
7
by: Entwickler | last post by:
hello, i have the following problem. i want to write a code that enables the user to call functions from a unmanaged code .dll at running time . so i have to use the late binding . i tried the...
0
by: rossabri | last post by:
This topic has been addressed in limited detail in other threads: "sockets don't play nice with new style classes :(" May 14 2005....
1
by: hitechabdul | last post by:
Hi... friends I m facing a problem in Sockets. I m continuosly opening a socket to record some data, and again I am closing that port. Again I m oipening same port to play data which wasa...
18
by: mdh | last post by:
>From p112 ( K&R). Given an array declared as static char arr= { { 0,1,........},{0,1,.....}}; let arr be passed as an argument to f. f( int (*arr) ) {....} It is noted that the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.