Class GprsSocket
GPRS socket instance.
Inheritance
Implements
Inherited Members
Namespace: Eclo.nF.SIM800H
Assembly: cs.temp.dll.dll
Syntax
public class GprsSocket : IDisposable
Constructors
GprsSocket(ProtocolType, Boolean)
Class with GPRS socket methods and properties
Declaration
public GprsSocket(ProtocolType protocolType, bool isSslSocket = false)
Parameters
Type | Name | Description |
---|---|---|
ProtocolType | protocolType | Protocol type of the socket |
System.Boolean | isSslSocket | True if socket is SLL. Default is false (not SSL). |
Properties
Status
Connection status of a GPRS socket
Declaration
public ConnectionStatus Status { get; }
Property Value
Type | Description |
---|---|
ConnectionStatus |
Methods
Close()
Close GPRS socket connection
Declaration
public void Close()
Connect(String, Int32)
Connects a GPRS socket to the specified URL and port. This operation requires that a GPRS connection has been open previous to call this otherwise an exception will throw.
Declaration
public void Connect(string remoteURL, int port)
Parameters
Type | Name | Description |
---|---|---|
System.String | remoteURL | URL where to connect |
System.Int32 | port | Port number where to connect |
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Finalize()
Declaration
protected void Finalize()
OnSocketClosed(GprsSocket)
Raises the OnSocketClosed(GprsSocket) event.
Declaration
protected virtual void OnSocketClosed(GprsSocket sender)
Parameters
Type | Name | Description |
---|---|---|
GprsSocket | sender | The object that raised the event. |
OnSocketConnected(GprsSocket)
Raises the OnSocketConnected(GprsSocket) event.
Declaration
protected virtual void OnSocketConnected(GprsSocket sender)
Parameters
Type | Name | Description |
---|---|---|
GprsSocket | sender | The object that raised the event. |
Receive(Byte[], Int32, Int32)
Declaration
public int Receive(byte[] buffer, int offset, int size)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | |
System.Int32 | offset | |
System.Int32 | size |
Returns
Type | Description |
---|---|
System.Int32 |
Send(Byte[])
Declaration
public int Send(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer |
Returns
Type | Description |
---|---|
System.Int32 |
Send(Byte[], Int32, Int32)
Declaration
public int Send(byte[] buffer, int offset, int size)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | |
System.Int32 | offset | |
System.Int32 | size |
Returns
Type | Description |
---|---|
System.Int32 |
Events
DataReceived
Event raised when the module emits a network registration message.
Declaration
public event GprsSocket.DataReceivedHandler DataReceived
Event Type
Type | Description |
---|---|
GprsSocket.DataReceivedHandler |
SocketClosed
Event raised when the module emits a network registration message.
Declaration
public event GprsSocket.SocketClosedHandler SocketClosed
Event Type
Type | Description |
---|---|
GprsSocket.SocketClosedHandler |
SocketConnected
Event raised when the module emits a network registration message.
Declaration
public event GprsSocket.SocketConnectedHandler SocketConnected
Event Type
Type | Description |
---|---|
GprsSocket.SocketConnectedHandler |