Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

socket_connect6(3) [debian man page]

socket_connect6(3)					     Library Functions Manual						socket_connect6(3)

NAME
socket_connect6 - attempt to make a TCP connection SYNTAX
#include <socket.h> int socket_connect6(int s, const char ip[16], uint16 port,uint32 scope_id); DESCRIPTION
socket_connect6 attempts to make a connection from TCP socket s to TCP port port on IP address ip. The meaning of scope_id is dependent on the implementation and IPv6 IP. On link-local IPv6 addresses it specifies the outgoing interface index. The name (e.g. "eth0") for a given interface index can be queried with getifname. scope_id should normally be set to 0. socket_connect6 may return o 0, to indicate that the connection succeeded (and succeeded immediately, if the socket is non-blocking) o -1, setting errno to error_inprogress or error_wouldblock, to indicate that the socket is non-blocking o -1, setting errno to something else, to indicate that the connection failed (and failed immediately, if the socket is non-blocking). When a background connection succeeds or fails, s becomes writable; you can use socket_connected to see whether the connection succeeded. If the connection failed, socket_connected returns 0, setting errno appropriately. Once a TCP socket is connected, you can use the read and write system calls to transmit data. You can call socket_connect6 without calling socket_bind6. This has the effect as first calling socket_bind6 with IP address :: and port 0. EXAMPLE
#include <socket.h> int s; char ip[16]; uint16 p; s = socket_tcp6(); socket_bind6(s,ip,p); socket_connect6(s,ip,p,0); SEE ALSO
socket_connect4(3), socket_getifname(3) socket_connect6(3)

Check Out this Related Man Page

socket_send6(3) 					     Library Functions Manual						   socket_send6(3)

NAME
socket_send6 - send a UDP datagram SYNTAX
#include <socket.h> ssize_t socket_send6(int s, const char* buf, size_t len, const char ip[16], uint16 port, uint32 scope_id); DESCRIPTION
socket_send6 sends len bytes starting at buf in a UDP datagram over the socket s to UDP port port on IP address ip. You can call socket_send6 without calling socket_bind6. This has the effect as first calling socket_bind6 with IP address :: and port 0. The meaning of scope_id is dependent on the implementation and IPv6 IP. On link-local IPv6 addresses it specifies the outgoing interface index. The name (e.g. "eth0") for a given interface index can be queried with getifname. scope_id should normally be set to 0. RETURN VALUE
socket_send6 returns 0 if the datagram was sent successfully. If not, it returns -1 and sets errno appropriately. EXAMPLE
#include <socket.h> int s; char ip[16]; uint16 p; uint32 scope_id; s = socket_tcp4(); socket_bind6(s,ip,p); socket_send6(s,"hello, world",12,ip,p,scope_id); SEE ALSO
socket_send4(3), socket_getifidx(3) socket_send6(3)
Man Page

7 More Discussions You Might Find Interesting

1. Programming

how to use function fork() in Windows NT

Hello, I need to make a gateway from Ethernet to RS-485. I am using stream socket, and I am programming in windows nt. I would like to know how could I use some functions from unix in windows nt. I would like to use the function fork(). Which library it uses and how can I get it? Can I... (1 Reply)
Discussion started by: danieljorge
1 Replies

2. UNIX for Advanced & Expert Users

TCP port scanner for remote or for local

I am unable to find any TCP scanner for data captruing for a Remote or local server. Can anybody please help. i need it to read TCP port and capture the incoming/outgoing data , (3 Replies)
Discussion started by: fahadsiddiqui
3 Replies

3. Programming

Socket programming in C

Hi, i know how to use socket for TCP applications, i also know how to use RAW socket, but i would like to use socket just over IP and bellow TCP, do you know how to do that ? i don't want to reimplement IP :) thanks for your answer. (2 Replies)
Discussion started by: nameless`
2 Replies

4. UNIX for Dummies Questions & Answers

TCP failed connection attempts from netstat -s

Dear experts, I am seeing a lot of TCP failed connection attempts from "netstat -s" on one of our servers. How can I pin point what connection failed and what are the ports involved? Any tools/commands I can dig in deeper to diag. what went wrong on these "failed connection attempts"? ... (2 Replies)
Discussion started by: cache51
2 Replies

5. Programming

Getting TCP Port status through C API

Does anyone know if there is a C API call to get the status of a TCP port? As opposed to running netstat and parsing the results. At the moment I have to attempt to bind() and pick up on the address in use error which isn't very elegant Thanks ---------- Post updated at 10:42 AM ----------... (0 Replies)
Discussion started by: janra
0 Replies

6. IP Networking

TCP port numbers reused

Hello all, I am loosing the diameter connection between two servers and when the connection is trying to comes up again i see the following message in the tracer. and after 1 second the connection resets. As far i know the connection stay in state TIME_WAIT for a while(60 seconds in my... (1 Reply)
Discussion started by: @dagio
1 Replies

7. Programming

Looping connect call for a non blocking socket

will there be any unexpected results on looping connect call for a non blocking socket to determine the connection based on error code. I am getting connection unsuccessful intermittently and so wondering whether is the timeout 500 millisec not sufficient or looping connect cause any unexpected. ... (7 Replies)
Discussion started by: satish@123
7 Replies