[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/System/Platform SocketMethods.cs,1.2
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/System/Platform SocketMethods.cs,1.2,1.3 |
Date: |
Tue, 27 May 2003 22:12:13 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/System/Platform
In directory subversions:/tmp/cvs-serv20864/System/Platform
Modified Files:
SocketMethods.cs
Log Message:
Modify the internalcall interface for sockets so that IPv4, IPv6,
and IrDA socket addresses will work.
Index: SocketMethods.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/Platform/SocketMethods.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** SocketMethods.cs 3 Apr 2003 05:40:44 -0000 1.2
--- SocketMethods.cs 28 May 2003 02:12:11 -0000 1.3
***************
*** 2,7 ****
* SocketMethods.cs - Implementation of the "Platform.SocketMethods" class.
*
* Copyright (C) 2002 Free Software Foundation
! * Author : Sidney Richards <address@hidden>
*
* This program is free software; you can redistribute it and/or modify
--- 2,9 ----
* SocketMethods.cs - Implementation of the "Platform.SocketMethods" class.
*
+ * Copyright (C) 2003 Southern Storm Software, Pty Ltd
* Copyright (C) 2002 Free Software Foundation
! *
! * Contributions from Sidney Richards <address@hidden>
*
* This program is free software; you can redistribute it and/or modify
***************
*** 33,80 ****
extern public static IntPtr GetInvalidHandle();
// Create a socket and obtain a socket descriptor (return true on
success).
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool Create(int af, int st, int pt, out IntPtr
handle);
! // Bind a socket to an IP address
! //TODO: add support for something other than IPv4
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static bool Bind(IntPtr handle, int af, long address, int
port);
! // Shutdown a socket
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool Shutdown(IntPtr handle, int how);
! // Start listening
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool Listen(IntPtr handle, int backlog);
! // Accept an incoming connection
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static bool Accept(IntPtr handle, out long address,
! out
int port, out IntPtr newHandle);
! // Connect to specified address
! // TODO: add support for something other than IPv4
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static bool Connect(IntPtr handle, int af, long address,
int port);
! // Receive bytes from connected socket
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int Receive(IntPtr handle, byte[] buffer, int
offset, int size, int flags);
! // Receive bytes from specified EndPoint (noted in address and port)
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int ReceiveFrom(IntPtr handle, byte[] buffer, int
offset, int size, int flags, out long address, out int port);
! // Send bytes to connected socket
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int Send(IntPtr handle, byte[] buffer, int offset,
int size, int flags);
! // Receive bytes from specified EndPoint (noted in address and port)
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int SendTo(IntPtr handle, byte[] buffer, int
offset, int size, int flags, long address, int port);
! // Close a socket (regardless of pending in/output)
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool Close(IntPtr handle);
--- 35,90 ----
extern public static IntPtr GetInvalidHandle();
+ // Determine if an address family is supported by the engine.
+ [MethodImpl(MethodImplOptions.InternalCall)]
+ extern public static bool AddressFamilySupported(int af);
+
// Create a socket and obtain a socket descriptor (return true on
success).
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool Create(int af, int st, int pt, out IntPtr
handle);
! // Bind a socket to a socket address.
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static bool Bind(IntPtr handle, byte[] addr);
! // Shutdown a socket.
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool Shutdown(IntPtr handle, int how);
! // Start listening.
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool Listen(IntPtr handle, int backlog);
! // Accept an incoming connection.
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static bool Accept(IntPtr handle, byte[] addrReturn,
! out
IntPtr newHandle);
! // Connect to specified address.
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static bool Connect(IntPtr handle, byte[] addr);
! // Receive bytes from connected socket.
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int Receive
! (IntPtr handle, byte[] buffer, int offset, int size, int flags);
! // Receive bytes from specified EndPoint (noted in address and port).
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int ReceiveFrom
! (IntPtr handle, byte[] buffer, int offset, int size,
! int flags, byte[] addrReturn);
! // Send bytes to connected socket.
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int Send
! (IntPtr handle, byte[] buffer, int offset, int size, int flags);
! // Receive bytes from specified EndPoint (noted in address and port).
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int SendTo
! (IntPtr handle, byte[] buffer, int offset, int size,
! int flags, byte[] addr);
! // Close a socket (regardless of pending in/output).
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool Close(IntPtr handle);
***************
*** 86,90 ****
// timeout is in microseconds.
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int Select(IntPtr[] readarray, IntPtr[]
writearray, IntPtr[] errorarray, long timeout);
// Change the blocking mode on a socket.
--- 96,102 ----
// timeout is in microseconds.
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static int Select
! (IntPtr[] readarray, IntPtr[] writearray,
! IntPtr[] errorarray, long timeout);
// Change the blocking mode on a socket.
***************
*** 98,103 ****
// Get the name of the local end-point on a socket.
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static bool GetSockName(IntPtr handle, out long address,
!
out int port);
// Set a numeric or boolean socket option.
--- 110,114 ----
// Get the name of the local end-point on a socket.
[MethodImpl(MethodImplOptions.InternalCall)]
! extern public static bool GetSockName(IntPtr handle, byte[] addrReturn);
// Set a numeric or boolean socket option.
***************
*** 121,133 ****
(IntPtr handle, out bool enabled, out int seconds);
! // Set a multicast socket option. TODO: ipv6
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool SetMulticastOption
! (IntPtr handle, int name, long group, long mcint);
! // Get a multicast socket option. TODO: ipv6
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool GetMulticastOption
! (IntPtr handle, int name, out long group, out long
mcint);
// Get the last-occurring system error code for the current thread.
--- 132,148 ----
(IntPtr handle, out bool enabled, out int seconds);
! // Set a multicast socket option.
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool SetMulticastOption
! (IntPtr handle, int af, int name, byte[] group, byte[]
mcint);
! // Get a multicast socket option.
[MethodImpl(MethodImplOptions.InternalCall)]
extern public static bool GetMulticastOption
! (IntPtr handle, int af, int name, byte[] group, byte[]
mcint);
!
! // Discover the IrDA devices that are available on a socket.
! [MethodImpl(MethodImplOptions.InternalCall)]
! extern public static bool DiscoverIrDADevices(IntPtr handle, byte[]
buf);
// Get the last-occurring system error code for the current thread.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/System/Platform SocketMethods.cs,1.2,1.3,
Rhys Weatherley <address@hidden> <=